diff --git a/src/frames.cc b/src/frames.cc index 143016eddd..11ef907b7c 100644 --- a/src/frames.cc +++ b/src/frames.cc @@ -230,14 +230,21 @@ SafeStackFrameIterator::SafeStackFrameIterator( reinterpret_cast(StandardFrame::ComputePCAddress(fp))); // If the top of stack is a return address to the interpreter trampoline, - // then we are likely in a bytecode handler with elided frame. In that - // case, set the PC properly and make sure we do not drop the frame. + // then we are likely in a bytecode handler with elided frame. Check if + // there is a bytecode array in the frame header, and if there is, case, set + // the PC properly and make sure we do not drop the frame. if (IsValidStackAddress(sp)) { MSAN_MEMORY_IS_INITIALIZED(sp, kPointerSize); Address tos = ReadMemoryAt(reinterpret_cast
(sp)); if (IsInterpreterFramePc(isolate, tos)) { - state.pc_address = reinterpret_cast(sp); - advance_frame = false; + Address bytecode_array = + fp + InterpreterFrameConstants::kBytecodeArrayFromFp; + if (IsValidStackAddress(bytecode_array)) { + if (Memory::Object_at(bytecode_array)->IsBytecodeArray()) { + state.pc_address = reinterpret_cast(sp); + advance_frame = false; + } + } } }