From: Ian Lance Taylor Date: Fri, 17 Apr 2015 21:59:10 +0000 (+0000) Subject: re PR go/65798 (runtime.Caller returns ok=true when return data is invalid) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=46f120ca7bc8b4a49c0d5a596b85aeca4a254698;p=gcc.git re PR go/65798 (runtime.Caller returns ok=true when return data is invalid) PR go/65798 runtime: In Caller don't return ok == true if PC == 0. GCC PR 65798 reports that this can happen in some cases. From-SVN: r222204 --- diff --git a/libgo/runtime/go-caller.c b/libgo/runtime/go-caller.c index ad151ecea8e..ed6fd107b0e 100644 --- a/libgo/runtime/go-caller.c +++ b/libgo/runtime/go-caller.c @@ -166,7 +166,7 @@ Caller (int skip) runtime_memclr (&ret, sizeof ret); n = runtime_callers (skip + 1, &loc, 1, false); - if (n < 1) + if (n < 1 || loc.pc == 0) return ret; ret.pc = loc.pc; ret.file = loc.filename;