summaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2013-02-02 15:11:48 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2013-02-02 15:11:48 +0000
commit94d403603d74cffa8459beb7876de784d0914583 (patch)
tree89371858c942dc7341fc149603e9815631e43ccf /libgo
parent9e5e87d91f058dfde84258615efe6d773e01f72b (diff)
downloadgcc-94d403603d74cffa8459beb7876de784d0914583.tar.gz
runtime: Correct handling of runtime.Callers skip parameter.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195685 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r--libgo/runtime/go-callers.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libgo/runtime/go-callers.c b/libgo/runtime/go-callers.c
index 9afba62cc99..dd1cf7909b6 100644
--- a/libgo/runtime/go-callers.c
+++ b/libgo/runtime/go-callers.c
@@ -115,8 +115,9 @@ Callers (int skip, struct __go_open_array pc)
/* 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. */
- ret = runtime_callers (skip - 1, locbuf, pc.__count);
+ compatibility. Normally we would add 1 to SKIP here, but we
+ don't so that we are compatible. */
+ ret = runtime_callers (skip, locbuf, pc.__count);
for (i = 0; i < ret; i++)
((uintptr *) pc.__values)[i] = locbuf[i].pc;