[clang][Interp][NFC] Add an assertion
authorTimm Bäder <tbaeder@redhat.com>
Wed, 11 Jan 2023 11:48:12 +0000 (12:48 +0100)
committerTimm Bäder <tbaeder@redhat.com>
Wed, 11 Jan 2023 12:05:14 +0000 (13:05 +0100)
This is unnecessary in the current state of the interpreter, but will ne
important later.

clang/lib/AST/Interp/ByteCodeExprGen.h

index f817fb4..4e4f2ee 100644 (file)
@@ -359,6 +359,7 @@ public:
   ExprScope(ByteCodeExprGen<Emitter> *Ctx) : LocalScope<Emitter>(Ctx) {}
 
   void addExtended(const Scope::Local &Local) override {
+    assert(this->Parent);
     this->Parent->addLocal(Local);
   }
 };