llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) <details> <summary>Changes</summary> Instead of asserting. This can happen in real-world code. --- Full diff: https://github.com/llvm/llvm-project/pull/80131.diff 2 Files Affected: - (modified) clang/lib/AST/Interp/ByteCodeExprGen.cpp (+2-1) - (modified) clang/test/Sema/struct-cast.c (+1) ``````````diff diff --git a/clang/lib/AST/Interp/ByteCodeExprGen.cpp b/clang/lib/AST/Interp/ByteCodeExprGen.cpp index 8188d6f7f5c24..a1c458a09e5ae 100644 --- a/clang/lib/AST/Interp/ByteCodeExprGen.cpp +++ b/clang/lib/AST/Interp/ByteCodeExprGen.cpp @@ -379,7 +379,8 @@ bool ByteCodeExprGen<Emitter>::VisitBinaryOperator(const BinaryOperator *BO) { return true; const ComparisonCategoryInfo *CmpInfo = Ctx.getASTContext().CompCategories.lookupInfoForType(BO->getType()); - assert(CmpInfo); + if (!CmpInfo) + return false; // We need a temporary variable holding our return value. if (!Initializing) { diff --git a/clang/test/Sema/struct-cast.c b/clang/test/Sema/struct-cast.c index 74d00c42c295e..05e5fa4f92ca7 100644 --- a/clang/test/Sema/struct-cast.c +++ b/clang/test/Sema/struct-cast.c @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only %s -verify +// RUN: %clang_cc1 -fsyntax-only %s -fexperimental-new-constant-interpreter -verify // expected-no-diagnostics struct S { `````````` </details> https://github.com/llvm/llvm-project/pull/80131 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits