diff options
| author | Austin Clements <austin@google.com> | 2015-02-03 09:09:56 -0500 |
|---|---|---|
| committer | Austin Clements <austin@google.com> | 2015-02-03 14:37:16 +0000 |
| commit | 67a03fd6a2c6d13154d7f27c464023422b83c05d (patch) | |
| tree | 42f622d0fc92bffbed0357c310e04ee2918b826b /src/runtime/stack1.go | |
| parent | c901bd01c131b6a3d1bbc7dde9de02cb7ce2544a (diff) | |
| download | go-67a03fd6a2c6d13154d7f27c464023422b83c05d.tar.xz | |
runtime: use 2*regSize for saved frame pointer check
Previously, we checked for a saved frame pointer by looking for a
2*ptrSize gap between the argument pointer and the locals pointer.
The intent of this check was to look for a two stack slot gap (caller
IP and saved frame pointer), but stack slots are regSize, not ptrSize.
Correct this by checking instead for a 2*regSize gap.
On most platforms, this made no difference because ptrSize==regSize.
However, on amd64p32 (nacl), the saved frame pointer check incorrectly
fired when there was no saved frame pointer because the one stack slot
for the caller IP left an 8 byte gap, which is 2*ptrSize (but not
2*regSize) on amd64p32.
Fixes #9760.
Change-Id: I6eedcf681fe5bf2bf924dde8a8f2d9860a4d758e
Reviewed-on: https://go-review.googlesource.com/3781
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/runtime/stack1.go')
| -rw-r--r-- | src/runtime/stack1.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/runtime/stack1.go b/src/runtime/stack1.go index 6a1f6aee92..3f89bb1739 100644 --- a/src/runtime/stack1.go +++ b/src/runtime/stack1.go @@ -466,9 +466,10 @@ func adjustframe(frame *stkframe, arg unsafe.Pointer) bool { } // Adjust saved base pointer if there is one. - if thechar == '6' && frame.argp-frame.varp == 2*ptrSize { + if thechar == '6' && frame.argp-frame.varp == 2*regSize { if !framepointer_enabled { print("runtime: found space for saved base pointer, but no framepointer experiment\n") + print("argp=", hex(frame.argp), " varp=", hex(frame.varp), "\n") throw("bad frame layout") } if stackDebug >= 3 { |
