@@ -3324,6 +3359,20 @@ llvm::Constant
*CodeGenFunction::EmitCheckTypeDescriptor(QualType T) {
DiagnosticsEngine::ak_qualtype, (intptr_t)T.getAsOpaquePtr(),
StringRef(),
StringRef(), std::nullopt, Buffer, std::nullopt);
+ if (IsBitInt) {
+// The Structure is:
https://github.com/AdamMagierFOSS closed
https://github.com/llvm/llvm-project/pull/80515
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/AdamMagierFOSS updated
https://github.com/llvm/llvm-project/pull/80515
>From d4b92b247dd55abd0ed1a9f599e77f6417475adf Mon Sep 17 00:00:00 2001
From: Adam Magier
Date: Sat, 3 Feb 2024 00:38:54 +0100
Subject: [PATCH] [clang][CodeGen][UBSan] Fixing shift-exponent generation for
https://github.com/AdamMagierFOSS updated
https://github.com/llvm/llvm-project/pull/80515
>From f990fb28b68bb42b35dde4abd9d39f03060e1e3f Mon Sep 17 00:00:00 2001
From: Adam Magier
Date: Sat, 3 Feb 2024 00:38:54 +0100
Subject: [PATCH] [clang][CodeGen][UBSan] Fixing shift-exponent generation for
https://github.com/AdamMagierFOSS updated
https://github.com/llvm/llvm-project/pull/80515
>From 4e1c37ae83dec050fc9b7aa172db01fa0b2b6d68 Mon Sep 17 00:00:00 2001
From: Adam Magier
Date: Sat, 3 Feb 2024 00:38:54 +0100
Subject: [PATCH 1/3] [clang][CodeGen][UBSan] Fixing shift-exponent generation
https://github.com/AdamMagierFOSS edited
https://github.com/llvm/llvm-project/pull/80515
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
AdamMagierFOSS wrote:
> > One thing I'll preemptively address is I didn't know where to put the new
> > unit testing - creating a separate file seems a little heavy handed but I
> > see that there's a test for UBSan shift generation
> > (`clang/test/CodeGen/ubsan-shift.c`) and one for UBSan +
@@ -0,0 +1,36 @@
+// RUN: %clang_cc1 %s -O0 -fsanitize=shift-exponent -emit-llvm -o - |
FileCheck %s
+
+// Checking that the code generation is using the unextended/untruncated
+// exponent values and capping the values accordingly
+
+// CHECK-LABEL: define{{.*}} i32 @test_left_v
@@ -4121,6 +4121,13 @@ Value *ScalarExprEmitter::GetWidthMinusOneValue(Value*
LHS,Value* RHS) {
Ty = cast(VT->getElementType());
else
Ty = cast(LHS->getType());
+ // Testing with small _BitInt types has shown that Ty->getBitwidth() - 1
AdamMagierFOS
@@ -0,0 +1,36 @@
+// RUN: %clang_cc1 %s -O0 -fsanitize=shift-exponent -emit-llvm -o - |
FileCheck %s
AdamMagierFOSS wrote:
Sounds good, thank you for the recommendation!
https://github.com/llvm/llvm-project/pull/80515
___
https://github.com/AdamMagierFOSS updated
https://github.com/llvm/llvm-project/pull/80515
>From 4e1c37ae83dec050fc9b7aa172db01fa0b2b6d68 Mon Sep 17 00:00:00 2001
From: Adam Magier
Date: Sat, 3 Feb 2024 00:38:54 +0100
Subject: [PATCH 1/2] [clang][CodeGen][UBSan] Fixing shift-exponent generation
https://github.com/AdamMagierFOSS edited
https://github.com/llvm/llvm-project/pull/80515
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
AdamMagierFOSS wrote:
One thing I'll preemptively address is I didn't know where to put the new unit
testing - creating a separate file seems a little heavy handed but I see that
there's a test for UBSan shift generation (`clang/test/CodeGen/ubsan-shift.c`)
and one for UBSan + _BitInt (`clang/
https://github.com/AdamMagierFOSS created
https://github.com/llvm/llvm-project/pull/80515
Testing the shift-exponent check with small width _BitInt values exposed a bug
in ScalarExprEmitter::GetWidthMinusOneValue when using the result to determine
valid exponent sizes. False positives were rep
Author: Adam Magier
Date: 2022-01-12T01:11:52+01:00
New Revision: b2715660ed0f821619f51158fb92cd8bddd105d8
URL:
https://github.com/llvm/llvm-project/commit/b2715660ed0f821619f51158fb92cd8bddd105d8
DIFF:
https://github.com/llvm/llvm-project/commit/b2715660ed0f821619f51158fb92cd8bddd105d8.diff
L
15 matches
Mail list logo