[llvm] Revert "[YAML] Init local var not set by some branches" (PR #123238)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 16 12:27:50 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-objectyaml

Author: Vitaly Buka (vitalybuka)

<details>
<summary>Changes</summary>

Reverts llvm/llvm-project#<!-- -->123137

It's a bug according to https://github.com/llvm/llvm-project/pull/123137#pullrequestreview-2555328813

---
Full diff: https://github.com/llvm/llvm-project/pull/123238.diff


1 Files Affected:

- (modified) llvm/lib/ObjectYAML/ELFYAML.cpp (+1-1) 


``````````diff
diff --git a/llvm/lib/ObjectYAML/ELFYAML.cpp b/llvm/lib/ObjectYAML/ELFYAML.cpp
index 83e6cf76dd746f..7e94d01a971534 100644
--- a/llvm/lib/ObjectYAML/ELFYAML.cpp
+++ b/llvm/lib/ObjectYAML/ELFYAML.cpp
@@ -1588,7 +1588,7 @@ static bool isInteger(StringRef Val) {
 
 void MappingTraits<std::unique_ptr<ELFYAML::Chunk>>::mapping(
     IO &IO, std::unique_ptr<ELFYAML::Chunk> &Section) {
-  ELFYAML::ELF_SHT Type = ELF::ET_NONE;
+  ELFYAML::ELF_SHT Type;
   StringRef TypeStr;
   if (IO.outputting()) {
     if (auto *S = dyn_cast<ELFYAML::Section>(Section.get()))

``````````

</details>


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


More information about the llvm-commits mailing list