Skip to content

Commit 90839f1

Browse files
authored
Widen the error message string when invoking the entrypoint (#58)
1 parent 7c9d5c8 commit 90839f1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/bootstrap.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,12 @@ void mono_doorstop_bootstrap(void *mono_domain) {
114114
LOG("Error invoking code!");
115115
if (mono.object_to_string) {
116116
void *str = mono.object_to_string(exc, NULL);
117-
char *exc_str = mono.string_to_utf8(str);
117+
char *exc_str_n = mono.string_to_utf8(str);
118+
char_t *exc_str = widen(exc_str_n);
118119
LOG("Error message: %s", exc_str);
120+
LOG("\n");
121+
free(exc_str);
122+
mono.free(exc_str_n);
119123
}
120124
}
121125
LOG("Done");

src/runtimes/mono.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ DEF_CALL(void, config_parse, const char *filename)
2727
DEF_CALL(void, set_assemblies_path, const char *path)
2828
DEF_CALL(void *, object_to_string, void *obj, void **exc)
2929
DEF_CALL(char *, string_to_utf8, void *s)
30+
DEF_CALL(void, free, void *ptr)
3031
DEF_CALL(void *, image_open_from_data_with_name, void *data,
3132
unsigned long data_len, int need_copy, MonoImageOpenStatus *status,
3233
int refonly, const char *name)

0 commit comments

Comments
 (0)