Commit 716ae2d6 authored by Marius Wachtler's avatar Marius Wachtler

unwinder: ignore disabled frames

this can happend when a deopt() call inside the llvm tier throws.
We would catch the exception in order to do some decrefs and than reraise it from the disabled frame.
parent 7b3743f6
......@@ -462,6 +462,9 @@ bool frameIsPythonFrame(unw_word_t ip, unw_word_t bp, unw_cursor_t* cursor, Pyth
}
}
if (info->getFrameInfo()->isDisabledFrame())
return false;
return true;
}
......
......@@ -1056,6 +1056,7 @@ struct FrameInfo {
// Calling disableDeinit makes future deinitFrameMaybe() frames not call deinitFrame().
// For use by deopt(), which takes over deinit responsibility for its caller.
void disableDeinit(FrameInfo* replacement_frame);
bool isDisabledFrame() const { return back == NO_DEINIT; }
FrameInfo(ExcInfo exc)
: exc(exc),
......
......@@ -247,17 +247,18 @@ void FrameInfo::disableDeinit(FrameInfo* replacement_frame) {
// Kinda hacky but maybe worth it to not store any extra bits:
back = NO_DEINIT;
assert(isDisabledFrame());
}
extern "C" void deinitFrameMaybe(FrameInfo* frame_info) {
// Note: this has to match FrameInfo::disableDeinit
if (frame_info->back != FrameInfo::NO_DEINIT)
if (!frame_info->isDisabledFrame())
deinitFrame(frame_info);
}
extern "C" void deinitFrame(FrameInfo* frame_info) {
// This can fire if we have a call to deinitFrame() that should be to deinitFrameMaybe() instead
assert(frame_info->back != FrameInfo::NO_DEINIT);
assert(!frame_info->isDisabledFrame());
assert(cur_thread_state.frame_info == frame_info);
cur_thread_state.frame_info = frame_info->back;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment