[clang] 12baf98 - [clang][Interp][NFC] Add another assertion to InterpStack::peek()

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 19 23:13:21 PDT 2023


Author: Timm Bäder
Date: 2023-07-20T08:12:58+02:00
New Revision: 12baf9859b70c653b3d67f5efdcaf608804efb5d

URL: https://github.com/llvm/llvm-project/commit/12baf9859b70c653b3d67f5efdcaf608804efb5d
DIFF: https://github.com/llvm/llvm-project/commit/12baf9859b70c653b3d67f5efdcaf608804efb5d.diff

LOG: [clang][Interp][NFC] Add another assertion to InterpStack::peek()

Added: 
    

Modified: 
    clang/lib/AST/Interp/InterpStack.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/InterpStack.h b/clang/lib/AST/Interp/InterpStack.h
index fd4a04a4d4cefe..14a9b69a557c15 100644
--- a/clang/lib/AST/Interp/InterpStack.h
+++ b/clang/lib/AST/Interp/InterpStack.h
@@ -54,6 +54,7 @@ class InterpStack final {
   /// 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


        


More information about the cfe-commits mailing list