diff options
author | Russ Cox <rsc@golang.org> | 2009-12-03 17:24:14 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-12-03 17:24:14 -0800 |
commit | cf37254b1cf0789e8bca6071e910d788f7dcf64f (patch) | |
tree | 724f1118eca540bb9d06cfde764fa2c3e3634cbb | |
parent | 6301fb41347a5f159242efad2a4af8f1ac213d34 (diff) | |
download | go-cf37254b1cf0789e8bca6071e910d788f7dcf64f.tar.gz go-cf37254b1cf0789e8bca6071e910d788f7dcf64f.zip |
runtime: fix Caller crash on 386.
Fixes #176.
R=r
https://golang.org/cl/166044
-rw-r--r-- | src/pkg/runtime/386/traceback.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/runtime/386/traceback.c b/src/pkg/runtime/386/traceback.c index febbb51d1e..60359e19c3 100644 --- a/src/pkg/runtime/386/traceback.c +++ b/src/pkg/runtime/386/traceback.c @@ -42,7 +42,7 @@ traceback(byte *pc0, byte *sp, G *g) if(f == nil) { // dangerous, but poke around to see if it is a closure // ADDL $xxx, SP; RET - if((uint64)pc > 0x1000 && p[0] == 0x81 && p[1] == 0xc4 && p[6] == 0xc3) { + if(pc > 0x1000 && p[0] == 0x81 && p[1] == 0xc4 && p[6] == 0xc3) { sp += *(uint32*)(p+2) + 8; pc = *(uintptr*)(sp - 8); if(pc <= 0x1000) @@ -130,7 +130,7 @@ runtime·Caller(int32 n, uintptr retpc, String retfile, int32 retline, bool retb // see if it is a closure. p = (byte*)pc; // ADDL $xxx, SP; RET - if(p[0] == 0x81 && p[1] == 0xc4 && p[6] == 0xc3) { + if(pc > 0x1000 && p[0] == 0x81 && p[1] == 0xc4 && p[6] == 0xc3) { sp += *(uint32*)(p+2) + sizeof(uintptr); goto loop; } |