aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/runtime.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-11-30 00:21:52 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-11-30 00:21:52 +0000
commitb87974949f096925805aec63eac7c5a02f2bb483 (patch)
tree365c588a8f44625a3f5aa828c39bd4189af0bb46 /libgo/runtime/runtime.c
parenta5922111851daf250abc704098c4cefdc4b629af (diff)
downloadgcc-b87974949f096925805aec63eac7c5a02f2bb483.zip
gcc-b87974949f096925805aec63eac7c5a02f2bb483.tar.gz
gcc-b87974949f096925805aec63eac7c5a02f2bb483.tar.bz2
runtime: Copy runtime_panicstring from master library.
From-SVN: r181830
Diffstat (limited to 'libgo/runtime/runtime.c')
-rw-r--r--libgo/runtime/runtime.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/libgo/runtime/runtime.c b/libgo/runtime/runtime.c
index de4c982..8e4433b 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;