switch cached Trigger values to be opaque-and-generic, rather than assuming CallExpr's

This commit is contained in:
Vern Paxson 2022-05-12 13:54:46 -07:00
parent 9ada7ac4e7
commit 5eb37e4c78
9 changed files with 50 additions and 40 deletions

View file

@ -258,10 +258,16 @@ public:
void ClearTrigger();
trigger::Trigger* GetTrigger() const { return trigger.get(); }
void SetCall(const CallExpr* arg_call) { call = arg_call; }
void ClearCall() { call = nullptr; }
void SetCall(const CallExpr* arg_call)
{
call = arg_call;
SetTriggerAssoc((void*)call);
}
const CallExpr* GetCall() const { return call; }
void SetTriggerAssoc(const void* arg_assoc) { assoc = arg_assoc; }
const void* GetTriggerAssoc() const { return assoc; }
void SetCallLoc(const Location* loc) { call_loc = loc; }
const detail::Location* GetCallLocation() const;
@ -388,6 +394,7 @@ private:
trigger::TriggerPtr trigger;
const CallExpr* call = nullptr;
const void* assoc = nullptr;
const Location* call_loc = nullptr; // only needed if call is nil
std::unique_ptr<std::vector<ScriptFunc*>> functions_with_closure_frame_reference;