File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -158,17 +158,18 @@ const llvm::fltSemantics &Context::getFloatSemantics(QualType T) const {
158158}
159159
160160bool Context::Run (State &Parent, const Function *Func, APValue &Result) {
161- InterpState State (Parent, *P, Stk, *this );
162- State.Current = new InterpFrame (State, Func, /* Caller=*/ nullptr , {});
163- if (Interpret (State, Result)) {
164- assert (Stk.empty ());
165- return true ;
166- }
167161
168- // We explicitly delete our state here, so the Stk.clear() call
169- // below doesn't violently free values the destructor would
170- // otherwise access.
171- State.~InterpState ();
162+ {
163+ InterpState State (Parent, *P, Stk, *this );
164+ State.Current = new InterpFrame (State, Func, /* Caller=*/ nullptr , {});
165+ if (Interpret (State, Result)) {
166+ assert (Stk.empty ());
167+ return true ;
168+ }
169+
170+ // State gets destroyed here, so the Stk.clear() below doesn't accidentally
171+ // remove values the State's destructor might accedd.
172+ }
172173
173174 Stk.clear ();
174175 return false ;
You can’t perform that action at this time.
0 commit comments