]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: correct misplaced right brace in Linux SIGBUS handling
authorIan Lance Taylor <iant@golang.org>
Sat, 23 Mar 2013 00:32:04 +0000 (17:32 -0700)
committerIan Lance Taylor <iant@golang.org>
Sat, 23 Mar 2013 00:32:04 +0000 (17:32 -0700)
I'm not sure how to write a test for this.  The change in
behaviour is that if you somehow get a SIGBUS signal for an
address >= 0x1000, the program will now crash rather than
calling panic.  As far as I know, on x86 GNU/Linux, the only
way to get a SIGBUS (rather than a SIGSEGV) is to set the
stack pointer to an invalid value.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7906045

src/pkg/runtime/os_linux.c

index 8aa4c3d35d1a2a7c74932154f19cdbb17d7eeb4f..e4ae1a5d80005ea3105c16afe83c3547ccdedf8f 100644 (file)
@@ -225,8 +225,8 @@ runtime·sigpanic(void)
                if(g->sigcode0 == BUS_ADRERR && g->sigcode1 < 0x1000) {
                        if(g->sigpc == 0)
                                runtime·panicstring("call of nil func value");
-                       }
                        runtime·panicstring("invalid memory address or nil pointer dereference");
+               }
                runtime·printf("unexpected fault address %p\n", g->sigcode1);
                runtime·throw("fault");
        case SIGSEGV: