diff --git a/src/Frame.cc b/src/Frame.cc index eca2a64b42..d668c49190 100644 --- a/src/Frame.cc +++ b/src/Frame.cc @@ -619,7 +619,7 @@ void Frame::CaptureClosure(Frame* c, IDPList arg_outer_ids) const detail::Location* Frame::GetCallLocation() const { - return call ? call->GetLocationInfo() : nullptr; + return call ? call->GetLocationInfo() : call_loc; } void Frame::SetTrigger(trigger::TriggerPtr arg_trigger) diff --git a/src/Frame.h b/src/Frame.h index 4188dded27..72b21c0ed5 100644 --- a/src/Frame.h +++ b/src/Frame.h @@ -262,6 +262,8 @@ public: void SetCall(const CallExpr* arg_call) { call = arg_call; } void ClearCall() { call = nullptr; } const CallExpr* GetCall() const { return call; } + + void SetCallLoc(const Location* loc) { call_loc = loc; } const detail::Location* GetCallLocation() const; void SetDelayed() { delayed = true; } @@ -390,6 +392,7 @@ private: trigger::TriggerPtr trigger; const CallExpr* call; + const Location* call_loc = nullptr; // only needed if call is nil std::unique_ptr> functions_with_closure_frame_reference; };