diff --git a/src/runtime/rt2_amd64.c b/src/runtime/rt2_amd64.c index 91bef543406..a3433678b2c 100644 --- a/src/runtime/rt2_amd64.c +++ b/src/runtime/rt2_amd64.c @@ -25,6 +25,13 @@ traceback(uint8 *pc, uint8 *sp, void* r15) // store local copy of per-process data block that we can write as we unwind mcpy((byte*)&g, (byte*)r15, sizeof(G)); + // if the PC is zero, it's probably due to a nil function pointer. + // pop the failed frame. + if(pc == nil) { + pc = ((uint8**)sp)[0]; + sp += 8; + } + counter = 0; name = "panic"; for(;;){