Author: Timm Bäder
Date: 2024-03-01T09:47:54+01:00
New Revision: 40c9a01773507e485f35aa76d3e31cf3ea8c3011

URL: 
https://github.com/llvm/llvm-project/commit/40c9a01773507e485f35aa76d3e31cf3ea8c3011
DIFF: 
https://github.com/llvm/llvm-project/commit/40c9a01773507e485f35aa76d3e31cf3ea8c3011.diff

LOG: [clang][Interp][NFC] Add an assertion to classify(Expr*)

NFC but makes the backtrace easier to read in case the expression
somehow ends up being null.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/Context.h b/clang/lib/AST/Interp/Context.h
index c7620921e467e7..dbb63e36918161 100644
--- a/clang/lib/AST/Interp/Context.h
+++ b/clang/lib/AST/Interp/Context.h
@@ -75,6 +75,7 @@ class Context final {
 
   /// Classifies an expression.
   std::optional<PrimType> classify(const Expr *E) const {
+    assert(E);
     if (E->isGLValue()) {
       if (E->getType()->isFunctionType())
         return PT_FnPtr;


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to