aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-03-30 00:01:07 -0700
committerRuss Cox <rsc@golang.org>2009-03-30 00:01:07 -0700
commit0d3a043de9b544ee3fca10fd1070a58f973161c4 (patch)
treebf180d18aa981bdbf3219e42024b2a50cdf40ea2 /src/runtime/runtime.c
parentde9cf52835c134a8e5a0df9a0880caa79b9b9b88 (diff)
downloadgo-0d3a043de9b544ee3fca10fd1070a58f973161c4.tar.xz
more 386 runtime - can run tiny c programs.
R=r DELTA=1926 (1727 added, 168 deleted, 31 changed) OCL=26876 CL=26878
Diffstat (limited to 'src/runtime/runtime.c')
-rw-r--r--src/runtime/runtime.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/runtime/runtime.c b/src/runtime/runtime.c
index a972b753f4..8a740f801e 100644
--- a/src/runtime/runtime.c
+++ b/src/runtime/runtime.c
@@ -5,7 +5,7 @@
#include "runtime.h"
int32 panicking = 0;
-int32 maxround = 8;
+int32 maxround = sizeof(uintptr);
int32
gotraceback(void)
@@ -54,6 +54,7 @@ throw(int8 *s)
prints("throw: ");
prints(s);
prints("\n");
+ sys·panicl(-1);
*(int32*)0 = 0;
sys_Exit(1);
}
@@ -183,6 +184,8 @@ getenv(int8 *s)
envv = (string*)sys·Envs.array;
envc = sys·Envs.nel;
for(i=0; i<envc; i++){
+ if(envv[i]->len <= len)
+ continue;
v = envv[i]->str;
for(j=0; j<len; j++)
if(bs[j] != v[j])
@@ -233,8 +236,8 @@ check(void)
if(sizeof(h) != 8) throw("bad h");
if(sizeof(i) != 4) throw("bad i");
if(sizeof(j) != 8) throw("bad j");
- if(sizeof(k) != 8) throw("bad k");
- if(sizeof(l) != 8) throw("bad l");
+ if(sizeof(k) != sizeof(uintptr)) throw("bad k");
+ if(sizeof(l) != sizeof(uintptr)) throw("bad l");
// prints(1"check ok\n");
uint32 z;
@@ -417,3 +420,10 @@ algarray[] =
[AFAKE] { nohash, noequal, noprint, nocopy },
};
+#pragma textflag 7
+void
+FLUSH(void *v)
+{
+ USED(v);
+}
+