]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix build
authorRuss Cox <rsc@golang.org>
Wed, 29 Sep 2010 00:50:00 +0000 (20:50 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 29 Sep 2010 00:50:00 +0000 (20:50 -0400)
On systems where the mmap succeeds
(e.g., sysctl -w vm.mmap_min_addr=0)
it changes the signal code delivered for a
nil fault from ``page not mapped'' to
``invalid permissions for page.''

TBR=r
CC=golang-dev
https://golang.org/cl/2294041

src/pkg/runtime/darwin/thread.c
src/pkg/runtime/freebsd/thread.c
src/pkg/runtime/linux/thread.c

index 6f64c08738640f7981e64887f1f3053faaf9cd95..f4dd180122d0cd39e9f9224f74449188f1ac5c4c 100644 (file)
@@ -456,7 +456,7 @@ sigpanic(void)
                printf("unexpected fault address %p\n", g->sigcode1);
                throw("fault");
        case SIGSEGV:
-               if((g->sigcode0 == 0 || g->sigcode0 == SEGV_MAPERR) && g->sigcode1 < 0x1000)
+               if((g->sigcode0 == 0 || g->sigcode0 == SEGV_MAPERR || g->sigcode0 == SEGV_ACCERR) && g->sigcode1 < 0x1000)
                        panicstring("invalid memory address or nil pointer dereference");
                printf("unexpected fault address %p\n", g->sigcode1);
                throw("fault");
index c9c058c5aef3cba260629ce51131573ebc8d10bf..27f8aa5ff5f380e3cffcb7205392237f862a2c6a 100644 (file)
@@ -182,7 +182,7 @@ sigpanic(void)
                printf("unexpected fault address %p\n", g->sigcode1);
                throw("fault");
        case SIGSEGV:
-               if((g->sigcode0 == 0 || g->sigcode0 == SEGV_MAPERR) && g->sigcode1 < 0x1000)
+               if((g->sigcode0 == 0 || g->sigcode0 == SEGV_MAPERR || g->sigcode0 == SEGV_ACCERR) && g->sigcode1 < 0x1000)
                        panicstring("invalid memory address or nil pointer dereference");
                printf("unexpected fault address %p\n", g->sigcode1);
                throw("fault");
index 47bf3428f7f9bdfe7f04ed8a79f9e57bc91296b8..f31838ea50d50412976514bf5931dd49f4c9bd72 100644 (file)
@@ -168,7 +168,7 @@ unlock(Lock *l)
 }
 
 void
-destroylock(Lock *l)
+destroylock(Lock*)
 {
 }
 
@@ -282,7 +282,7 @@ sigpanic(void)
                printf("unexpected fault address %p\n", g->sigcode1);
                throw("fault");
        case SIGSEGV:
-               if((g->sigcode0 == 0 || g->sigcode0 == SEGV_MAPERR) && g->sigcode1 < 0x1000)
+               if((g->sigcode0 == 0 || g->sigcode0 == SEGV_MAPERR || g->sigcode0 == SEGV_ACCERR) && g->sigcode1 < 0x1000)
                        panicstring("invalid memory address or nil pointer dereference");
                printf("unexpected fault address %p\n", g->sigcode1);
                throw("fault");