From 46f120ca7bc8b4a49c0d5a596b85aeca4a254698 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 17 Apr 2015 21:59:10 +0000 Subject: [PATCH] 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 --- libgo/runtime/go-caller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;