[llvm] r237875 - MC: Initialize MCSymbolData::Offset directly
Duncan P. N. Exon Smith
dexonsmith at apple.com
Wed May 20 18:59:59 PDT 2015
Author: dexonsmith
Date: Wed May 20 20:59:58 2015
New Revision: 237875
URL: http://llvm.org/viewvc/llvm-project?rev=237875&view=rev
Log:
MC: Initialize MCSymbolData::Offset directly
Try to fix miscompile after r237873. Looks like this union
initialization isn't legal (or at least not supported).
Modified:
llvm/trunk/include/llvm/MC/MCSymbol.h
Modified: llvm/trunk/include/llvm/MC/MCSymbol.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSymbol.h?rev=237875&r1=237874&r2=237875&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCSymbol.h (original)
+++ llvm/trunk/include/llvm/MC/MCSymbol.h Wed May 20 20:59:58 2015
@@ -37,7 +37,7 @@ class MCSymbolData {
union {
/// Offset - The offset to apply to the fragment address to form this
/// symbol's value.
- uint64_t Offset = 0;
+ uint64_t Offset;
/// CommonSize - The size of the symbol, if it is 'common'.
uint64_t CommonSize;
@@ -60,6 +60,8 @@ class MCSymbolData {
uint64_t Index = 0;
public:
+ MCSymbolData() { Offset = 0; }
+
MCFragment *getFragment() const { return Fragment.getPointer(); }
void setFragment(MCFragment *Value) { Fragment.setPointer(Value); }
More information about the llvm-commits
mailing list