@@ -98,3 +98,6 @@ enum E8 { A8 = -128, B8 = 127 } x8;
// CHECK-NOT: DIFlagEnumClass
// CHECK: !DIEnumerator(name: "A8", value: -128)
+// Forward declaration of an enum class.
+enum class Color : int;
+// CHECK-NOT: !DICompositeType(tag: DW_TAG_enumeration_type, name: "Color"
-
smanna12 wrote:
I am unable to add new change in this PR. Follow-up is here:
https://github.com/llvm/llvm-project/pull/105556.
https://github.com/llvm/llvm-project/pull/97105
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.o
https://github.com/smanna12 closed
https://github.com/llvm/llvm-project/pull/97105
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -98,3 +98,6 @@ enum E8 { A8 = -128, B8 = 127 } x8;
// CHECK-NOT: DIFlagEnumClass
// CHECK: !DIEnumerator(name: "A8", value: -128)
+// Forward declaration of an enum class.
+enum class Color : int;
+// CHECK-NOT: !DICompositeType(tag: DW_TAG_enumeration_type, name: "Color"
-
@@ -98,3 +98,6 @@ enum E8 { A8 = -128, B8 = 127 } x8;
// CHECK-NOT: DIFlagEnumClass
// CHECK: !DIEnumerator(name: "A8", value: -128)
+// Forward declaration of an enum class.
+enum class Color : int;
+// CHECK-NOT: !DICompositeType(tag: DW_TAG_enumeration_type, name: "Color"
-
smanna12 wrote:
> Thanks @smanna12. I think this looks ok; returning null here does appear to
> be consistent with other overloads of `CreateTypeDefinition` for `RecordType`
> and `ObjCInterfaceType`. I agree with @Michael137 that it would be nice to
> have an example that fails the added cond
https://github.com/smanna12 updated
https://github.com/llvm/llvm-project/pull/97105
>From 5a4f0207afa9a473ba8ebf1e24a75730cd13a553 Mon Sep 17 00:00:00 2001
From: "Manna, Soumi"
Date: Fri, 28 Jun 2024 12:58:45 -0700
Subject: [PATCH 1/2] [Clang] Fix null pointer dereference in enum debug info
ge
dwblaikie wrote:
> Thanks @smanna12. I think this looks ok; returning null here does appear to
> be consistent with other overloads of `CreateTypeDefinition` for `RecordType`
> and `ObjCInterfaceType`. I agree with @Michael137 that it would be nice to
> have an example that fails the added con
https://github.com/tahonermann approved this pull request.
Thanks @smanna12. I think this looks ok; returning null here does appear to be
consistent with other overloads of `CreateTypeDefinition` for `RecordType` and
`ObjCInterfaceType`. I agree with @Michael137 that it would be nice to have an
@@ -3518,6 +3518,10 @@ llvm::DIType *CGDebugInfo::CreateTypeDefinition(const
EnumType *Ty) {
SmallVector Enumerators;
ED = ED->getDefinition();
+
+ if (!ED)
+return nullptr;
+
Michael137 wrote:
Do you have an example/reproducer where this would get
llvmbot wrote:
@llvm/pr-subscribers-clang
@llvm/pr-subscribers-clang-codegen
Author: None (smanna12)
Changes
This patch prevents dereferencing a null enum definition by returning `nullptr`
if `getDefinition()` fails in `CreateTypeDefinition()`.
---
Full diff: https://github.com/llvm/llvm
https://github.com/smanna12 created
https://github.com/llvm/llvm-project/pull/97105
This patch prevents dereferencing a null enum definition by returning `nullptr`
if `getDefinition()` fails in `CreateTypeDefinition()`.
>From 5a4f0207afa9a473ba8ebf1e24a75730cd13a553 Mon Sep 17 00:00:00 2001
Fr
12 matches
Mail list logo