runtime: Correct handling of runtime.Callers skip parameter.

From-SVN: r195685
This commit is contained in:
Ian Lance Taylor 2013-02-02 15:11:48 +00:00
parent 0cab6b73df
commit 7ebe663e98

View File

@ -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;