summaryrefslogtreecommitdiffstats
path: root/llgo/third_party/gofrontend/libgo/runtime/go-caller.c
diff options
context:
space:
mode:
Diffstat (limited to 'llgo/third_party/gofrontend/libgo/runtime/go-caller.c')
-rw-r--r--llgo/third_party/gofrontend/libgo/runtime/go-caller.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/llgo/third_party/gofrontend/libgo/runtime/go-caller.c b/llgo/third_party/gofrontend/libgo/runtime/go-caller.c
index ad151ecea8e..d6901e07377 100644
--- a/llgo/third_party/gofrontend/libgo/runtime/go-caller.c
+++ b/llgo/third_party/gofrontend/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;
@@ -231,6 +231,8 @@ String runtime_funcname_go (Func *f)
String
runtime_funcname_go (Func *f)
{
+ if (f == NULL)
+ return runtime_gostringnocopy ((const byte *) "");
return f->name;
}
OpenPOWER on IntegriCloud