Commit 7ebe663e by Ian Lance Taylor

runtime: Correct handling of runtime.Callers skip parameter.

From-SVN: r195685
parent 0cab6b73
...@@ -115,8 +115,9 @@ Callers (int skip, struct __go_open_array pc) ...@@ -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, /* In the Go 1 release runtime.Callers has an off-by-one error,
which we can not correct because it would break backward which we can not correct because it would break backward
compatibility. Adjust SKIP here to be compatible. */ compatibility. Normally we would add 1 to SKIP here, but we
ret = runtime_callers (skip - 1, locbuf, pc.__count); don't so that we are compatible. */
ret = runtime_callers (skip, locbuf, pc.__count);
for (i = 0; i < ret; i++) for (i = 0; i < ret; i++)
((uintptr *) pc.__values)[i] = locbuf[i].pc; ((uintptr *) pc.__values)[i] = locbuf[i].pc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment