From ec9eefcef560e4ea5b5d8ee6ed9cc6ef8c1f274c Mon Sep 17 00:00:00 2001 From: Timm Baeder Date: Sun, 6 Jul 2025 16:42:06 +0200 Subject: [clang][bytecode] Fix a crash in overflow builtins (#147189) Only initialize pointers that can be initialized. --- clang/test/AST/ByteCode/builtin-functions.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'clang/test/AST/ByteCode/builtin-functions.cpp') diff --git a/clang/test/AST/ByteCode/builtin-functions.cpp b/clang/test/AST/ByteCode/builtin-functions.cpp index 3b95a8e..1bb6d22 100644 --- a/clang/test/AST/ByteCode/builtin-functions.cpp +++ b/clang/test/AST/ByteCode/builtin-functions.cpp @@ -1753,4 +1753,12 @@ namespace I128Mul { } #endif +namespace InitParam { + constexpr int foo(int a) { + __builtin_mul_overflow(20, 10, &a); + return a; + } + static_assert(foo(10) == 200); +} + #endif -- cgit v1.1