diff --git a/js/src/ion/IonFrames.cpp b/js/src/ion/IonFrames.cpp index 5e2a30b79da..e19877a5bbd 100644 --- a/js/src/ion/IonFrames.cpp +++ b/js/src/ion/IonFrames.cpp @@ -1049,6 +1049,15 @@ GetPcScript(JSContext *cx, JSScript **scriptRes, jsbytecode **pcRes) // Recover the return address. IonFrameIterator it(rt->mainThread.ionTop); + // If the previous frame is a rectifier frame (maybe unwound), + // skip past it. + if (it.prevType() == IonFrame_Rectifier || it.prevType() == IonFrame_Unwound_Rectifier) { + ++it; + JS_ASSERT(it.prevType() == IonFrame_BaselineStub || + it.prevType() == IonFrame_BaselineJS || + it.prevType() == IonFrame_OptimizedJS); + } + // If the previous frame is a stub frame, skip the exit frame so that // returnAddress below gets the return address into the BaselineJS // frame.