[llvm] [yaml2obj] Don't use uninitialized Type (PR #123274)

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 21 09:07:18 PST 2025


================
@@ -454,3 +454,19 @@ Sections:
 # LINK-NEXT:   [ 2] .ref.first PROGBITS [[#%x,]] [[#%x,]] [[#%x,]] [[#%x,]]      1
 # LINK-NEXT:   [ 3] .ref.last  PROGBITS [[#%x,]] [[#%x,]] [[#%x,]] [[#%x,]]      4
 # LINK-NEXT:   [ 4] .shstrtab
+
+# Must not crash under Msan.
+# RUN: not yaml2obj %s --docnum=15 -o %t15 2>&1 | FileCheck %s --check-prefix=FOO_SECTION
+
+--- !ELF
+FileHeader:
+  Class: ELFCLASS64
+  Data:  ELFDATA2LSB
+  Type:  ET_REL
+Sections:
+  - Name: .foo
+    Type: FOO_SECTION
+    Size: 0x10
+    Content: [[<none>]]
----------------
vitalybuka wrote:

removed, unneeded to trigger msan 

https://github.com/llvm/llvm-project/pull/123274


More information about the llvm-commits mailing list