[clang][Interp][NFC] Add another assertion to InterpStack::peek()
authorTimm Bäder <tbaeder@redhat.com>
Wed, 19 Jul 2023 13:58:40 +0000 (15:58 +0200)
committerTimm Bäder <tbaeder@redhat.com>
Thu, 20 Jul 2023 06:12:58 +0000 (08:12 +0200)
clang/lib/AST/Interp/InterpStack.h

index fd4a04a..14a9b69 100644 (file)
@@ -54,6 +54,7 @@ public:
   /// Discards the top value from the stack.
   template <typename T> void discard() {
 #ifndef NDEBUG
+    assert(!ItemTypes.empty());
     assert(ItemTypes.back() == toPrimType<T>());
     ItemTypes.pop_back();
 #endif