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

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 22 00:52:47 PST 2025


================
@@ -25,3 +25,31 @@ Sections:
     Type:  0xabcd
   - Name:  decimal
     Type:  1234
+
+
+# RUN: not yaml2obj %s --docnum=2 -o %t2 2>&1 | FileCheck %s --check-prefix=UNKNOWN-TYPE
+
+--- !ELF
+FileHeader:
+  Class: ELFCLASS64
+  Data:  ELFDATA2LSB
+  Type:  ET_REL
+Sections:
+  - Name: .foo
+    Type: FOO_SECTION
+
+# UNKNOWN-TYPE: error: invalid hex32 number
+
+
----------------
jh7370 wrote:

Same comment as above, but here you can say something like "... that are a section type that has no known meaning." or something to that effect.

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


More information about the llvm-commits mailing list