diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-05-21 01:59:58 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-05-21 01:59:58 +0000 |
commit | 1d4f2ba509eebf9aaaec2412a4772b6969e49974 (patch) | |
tree | acc1e562efbb5185ba21b5382dfd9373b4c70238 | |
parent | 8eca988b00ad9dde185183c664f422615ef87b48 (diff) |
MC: Initialize MCSymbolData::Offset directly
Try to fix miscompile after r237873. Looks like this union
initialization isn't legal (or at least not supported).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237875 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/MC/MCSymbol.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/llvm/MC/MCSymbol.h b/include/llvm/MC/MCSymbol.h index 26b416e47bc..6f396a50c0d 100644 --- a/include/llvm/MC/MCSymbol.h +++ b/include/llvm/MC/MCSymbol.h @@ -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); } |