@@ -17,7 +17,14 @@ using namespace clang::interp;
17
17
18
18
InterpState::InterpState (State &Parent, Program &P, InterpStack &Stk,
19
19
Context &Ctx, SourceMapper *M)
20
- : Parent(Parent), M(M), P(P), Stk(Stk), Ctx(Ctx), Current(nullptr ) {}
20
+ : Parent(Parent), M(M), P(P), Stk(Stk), Ctx(Ctx), BottomFrame(*this ),
21
+ Current(&BottomFrame) {}
22
+
23
+ InterpState::InterpState (State &Parent, Program &P, InterpStack &Stk,
24
+ Context &Ctx, const Function *Func)
25
+ : Parent(Parent), M(nullptr ), P(P), Stk(Stk), Ctx(Ctx),
26
+ BottomFrame(*this , Func, nullptr , CodePtr(), Func->getArgSize()),
27
+ Current(&BottomFrame) {}
21
28
22
29
bool InterpState::inConstantContext () const {
23
30
if (ConstantContextOverride)
@@ -27,11 +34,12 @@ bool InterpState::inConstantContext() const {
27
34
}
28
35
29
36
InterpState::~InterpState () {
30
- while (Current) {
37
+ while (Current && !Current-> isBottomFrame () ) {
31
38
InterpFrame *Next = Current->Caller ;
32
39
delete Current;
33
40
Current = Next;
34
41
}
42
+ BottomFrame.destroyScopes ();
35
43
36
44
while (DeadBlocks) {
37
45
DeadBlock *Next = DeadBlocks->Next ;
0 commit comments