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
This commit is contained in:
Ian Lance Taylor 2015-04-17 21:59:10 +00:00
parent 759fde68ea
commit 46f120ca7b
1 changed files with 1 additions and 1 deletions

View File

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