From 6cd35912c0486dd73c62f94dc924731e0c1f195a Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Sat, 25 Jul 2015 05:57:24 +0000 Subject: [CodeGen] Don't UBSan-ize the argument to __builtin_frame_address __builtin_frame_address requires its argument to be a constant expression which already implies that it cannot have undefined behavior. However, we used EmitScalarExpr to emit the argument causing UBSan to try to check for overflow. Instead, use the constant expression emission system. This fixes PR24256. llvm-svn: 243206 --- clang/test/CodeGen/integer-overflow.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'clang/test/CodeGen/integer-overflow.c') diff --git a/clang/test/CodeGen/integer-overflow.c b/clang/test/CodeGen/integer-overflow.c index de3b53f..6a7c3e5 100644 --- a/clang/test/CodeGen/integer-overflow.c +++ b/clang/test/CodeGen/integer-overflow.c @@ -72,4 +72,11 @@ void test1() { // TRAPV: add i8 {{.*}}, 1 // CATCH_UB: add i8 {{.*}}, 1 ++PR9350; + + // PR24256: don't instrument __builtin_frame_address. + __builtin_frame_address(0 + 0); + // DEFAULT: call i8* @llvm.frameaddress(i32 0) + // WRAPV: call i8* @llvm.frameaddress(i32 0) + // TRAPV: call i8* @llvm.frameaddress(i32 0) + // CATCH_UB: call i8* @llvm.frameaddress(i32 0) } -- cgit v1.1