llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

<details>
<summary>Changes</summary>

Fixes #<!-- -->157422

---
Full diff: https://github.com/llvm/llvm-project/pull/157490.diff


2 Files Affected:

- (modified) clang/lib/AST/ByteCode/InterpBuiltin.cpp (+3) 
- (modified) clang/test/AST/ByteCode/builtins.cpp (+7) 


``````````diff
diff --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp 
b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
index a0dcdace854b9..0c22890a00dbb 100644
--- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp
+++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
@@ -910,6 +910,9 @@ static bool interp__builtin_carryop(InterpState &S, CodePtr 
OpPC,
   APSInt RHS = popToAPSInt(S.Stk, RHST);
   APSInt LHS = popToAPSInt(S.Stk, LHST);
 
+  if (CarryOutPtr.isDummy())
+    return false;
+
   APSInt CarryOut;
 
   APSInt Result;
diff --git a/clang/test/AST/ByteCode/builtins.cpp 
b/clang/test/AST/ByteCode/builtins.cpp
index 9b2b20773be58..33b703c24cb51 100644
--- a/clang/test/AST/ByteCode/builtins.cpp
+++ b/clang/test/AST/ByteCode/builtins.cpp
@@ -36,3 +36,10 @@ void test_builtin_os_log(void *buf, int i, const char *data) 
{
   constexpr int len = __builtin_os_log_format_buffer_size("%d %{public}s 
%{private}.16P", i, data, data);
   static_assert(len > 0, "Expect len > 0");
 }
+
+void addc_dummy()
+{
+  unsigned int a;
+  if (__builtin_addc (1, 42, 0, &a))
+    __builtin_abort ();
+}

``````````

</details>


https://github.com/llvm/llvm-project/pull/157490
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to