summaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-22 21:52:56 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-22 21:52:56 +0000
commitd65d9e7a8dcbdc47784f5aa7386359311c69de94 (patch)
treeefb5461445eb92b4072ef9713ca5be99ae761e3e /libgo
parentd0c5362c879d079699d53534f3c41c5d0cb03d55 (diff)
downloadgcc-d65d9e7a8dcbdc47784f5aa7386359311c69de94.tar.gz
runtime: Tweak runtime.Callers for Go 1 compatibility.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187781 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r--libgo/runtime/go-callers.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libgo/runtime/go-callers.c b/libgo/runtime/go-callers.c
index 2d8fce73de4..3eea5f2cead 100644
--- a/libgo/runtime/go-callers.c
+++ b/libgo/runtime/go-callers.c
@@ -72,5 +72,8 @@ int Callers (int, struct __go_open_array)
int
Callers (int skip, struct __go_open_array pc)
{
- return runtime_callers (skip, (uintptr *) pc.__values, pc.__count);
+ /* In the Go 1 release runtime.Callers has an off-by-one error,
+ which we can not correct because it would break backward
+ compatibility. Adjust SKIP here to be compatible. */
+ return runtime_callers (skip - 1, (uintptr *) pc.__values, pc.__count);
}