diff options
Diffstat (limited to 'libgo/runtime/runtime.c')
-rw-r--r-- | libgo/runtime/runtime.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/libgo/runtime/runtime.c b/libgo/runtime/runtime.c index de4c982620f..8e4433b0d6c 100644 --- a/libgo/runtime/runtime.c +++ b/libgo/runtime/runtime.c @@ -70,6 +70,19 @@ runtime_throw(const char *s) runtime_exit(1); // even more not reached } +void +runtime_panicstring(const char *s) +{ + Eface err; + + if(runtime_m()->gcing) { + runtime_printf("panic: %s\n", s); + runtime_throw("panic during gc"); + } + runtime_newErrorString(runtime_gostringnocopy((const byte*)s), &err); + runtime_panic(err); +} + static int32 argc; static byte** argv; @@ -95,7 +108,7 @@ runtime_goargs(void) s = runtime_malloc(argc*sizeof s[0]); for(i=0; i<argc; i++) - s[i] = runtime_gostringnocopy((byte*)argv[i]); + s[i] = runtime_gostringnocopy((const byte*)argv[i]); os_Args.__values = (void*)s; os_Args.__count = argc; os_Args.__capacity = argc; |