diff --git a/llvm/tools/yaml2obj/yaml2elf.cpp b/llvm/tools/yaml2obj/yaml2elf.cpp index 1792b1288829..ae8dd15f5967 100644 --- a/llvm/tools/yaml2obj/yaml2elf.cpp +++ b/llvm/tools/yaml2obj/yaml2elf.cpp @@ -76,7 +76,7 @@ public: } /// asserts if name is not present in the map unsigned get(StringRef Name) const { - unsigned Idx; + unsigned Idx = 0; assert(!lookup(Name, Idx) && "Expected section not found in index"); return Idx; }