[llvm] r207788 - Fix uninitialized variable introduced in r207739.

David Blaikie dblaikie at gmail.com
Thu May 1 12:55:34 PDT 2014


Author: dblaikie
Date: Thu May  1 14:55:34 2014
New Revision: 207788

URL: http://llvm.org/viewvc/llvm-project?rev=207788&view=rev
Log:
Fix uninitialized variable introduced in r207739.

This was initialized by llvm-mc (calling setDwarfVersion) but other
clients (such as clang, llc, etc) aren't necessarily initializing this
so we were getting garbage DWARF version values in the output.
Initialize it to a reasonable default (the same default used in llvm-mc,
though this is higher than it was (2) previously).

Modified:
    llvm/trunk/lib/MC/MCContext.cpp

Modified: llvm/trunk/lib/MC/MCContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCContext.cpp?rev=207788&r1=207787&r2=207788&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCContext.cpp (original)
+++ llvm/trunk/lib/MC/MCContext.cpp Thu May  1 14:55:34 2014
@@ -35,7 +35,7 @@ MCContext::MCContext(const MCAsmInfo *ma
     : SrcMgr(mgr), MAI(mai), MRI(mri), MOFI(mofi), Allocator(),
       Symbols(Allocator), UsedNames(Allocator), NextUniqueID(0),
       CurrentDwarfLoc(0, 0, 0, DWARF2_FLAG_IS_STMT, 0, 0), DwarfLocSeen(false),
-      GenDwarfForAssembly(false), GenDwarfFileNumber(0),
+      GenDwarfForAssembly(false), GenDwarfFileNumber(0), DwarfVersion(4),
       AllowTemporaryLabels(true), DwarfCompileUnitID(0),
       AutoReset(DoAutoReset) {
 





More information about the llvm-commits mailing list