From: Ian Lance Taylor Date: Tue, 22 May 2012 21:52:56 +0000 (+0000) Subject: runtime: Tweak runtime.Callers for Go 1 compatibility. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4579805199475b408ec9a837b0f27c9e1c9d0f6d;hp=19460426c33107c0c1d3e94517fdddd0ea3fcf2f;p=gcc.git runtime: Tweak runtime.Callers for Go 1 compatibility. From-SVN: r187781 --- 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); }