diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2013-02-02 15:11:48 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2013-02-02 15:11:48 +0000 |
commit | 7ebe663e98c59128f4d94944bf91b55f514fbc4b (patch) | |
tree | 89371858c942dc7341fc149603e9815631e43ccf | |
parent | 0cab6b73df8b8fc78a6f68e664867d1dbbeea9e5 (diff) | |
download | gcc-7ebe663e98c59128f4d94944bf91b55f514fbc4b.zip gcc-7ebe663e98c59128f4d94944bf91b55f514fbc4b.tar.gz gcc-7ebe663e98c59128f4d94944bf91b55f514fbc4b.tar.bz2 |
runtime: Correct handling of runtime.Callers skip parameter.
From-SVN: r195685
-rw-r--r-- | libgo/runtime/go-callers.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libgo/runtime/go-callers.c b/libgo/runtime/go-callers.c index 9afba62..dd1cf79 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; |