diff --git a/src/compile.cpp b/src/compile.cpp index 2f59212c13..ca61548ad6 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -213,22 +213,25 @@ class MyStackWalker: public Processor::StackWalker { base = *static_cast(base); ip_ = *static_cast(stack); method_ = methodForIp(t, *static_cast(stack)); - if (method_ == 0) { - if (trace and trace->stack) { - base = trace->base; - stack = static_cast(trace->stack); - ip_ = *static_cast(stack); - method_ = methodForIp(t, *static_cast(stack)); - nativeMethod = trace->nativeMethod; - trace = trace->next; - } else { - return false; - } - } } else { return false; } - return true; + + if (method_ or nativeMethod) { + return true; + } else if (trace and trace->stack) { + base = trace->base; + stack = static_cast(trace->stack); + ip_ = *static_cast(stack); + method_ = methodForIp(t, *static_cast(stack)); + nativeMethod = trace->nativeMethod; + trace = trace->next; + + expect(t, method_ or nativeMethod); + return true; + } else { + return false; + } } virtual object method() {