]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: homogenize panic strings on Plan 9
authorDavid du Colombier <0intro@gmail.com>
Tue, 11 Feb 2014 08:34:43 +0000 (09:34 +0100)
committerDavid du Colombier <0intro@gmail.com>
Tue, 11 Feb 2014 08:34:43 +0000 (09:34 +0100)
LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/61410046

src/pkg/runtime/os_plan9.c

index dd2828b1d9a30ac70bf0d1f2a475b808724ded47..214cb224ba72d8bf6959d7d7185e76522d8ae079 100644 (file)
@@ -310,6 +310,10 @@ runtime·sigpanic(void)
 {
        if(g->sigpc == 0)
                runtime·panicstring("call of nil func value");
+       if(runtime·strcmp((byte*)m->notesig, (byte*)"sys: trap: fault read addr") >= 0 || runtime·strcmp((byte*)m->notesig, (byte*)"sys: trap: fault write addr") >= 0)
+               runtime·panicstring("invalid memory address or nil pointer dereference");
+       if(runtime·strcmp((byte*)m->notesig, (byte*)"sys: trap: divide error") >= 0)
+               runtime·panicstring("integer divide by zero");
        runtime·panicstring(m->notesig);
 
        if(g->sig == 1 || g->sig == 2)