aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm/lib/MC/WasmObjectWriter.cpp
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2018-01-30 16:43:20 +0000
committerEd Maste <emaste@FreeBSD.org>2018-01-30 16:43:20 +0000
commite5c2ece7149b54b4298768bb5c33f3090456d0eb (patch)
treede350f40fe00b81c7afbdd10be5253c1a5844e50 /contrib/llvm/lib/MC/WasmObjectWriter.cpp
parent88e56272f9989b1c1d78c7d3f6346c0428e18db6 (diff)
Notes
Diffstat (limited to 'contrib/llvm/lib/MC/WasmObjectWriter.cpp')
-rw-r--r--contrib/llvm/lib/MC/WasmObjectWriter.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/llvm/lib/MC/WasmObjectWriter.cpp b/contrib/llvm/lib/MC/WasmObjectWriter.cpp
index 0f0b645492ee..66236e3abfab 100644
--- a/contrib/llvm/lib/MC/WasmObjectWriter.cpp
+++ b/contrib/llvm/lib/MC/WasmObjectWriter.cpp
@@ -528,7 +528,10 @@ static void addData(SmallVectorImpl<char> &DataBytes,
Align->getMaxBytesToEmit());
DataBytes.resize(Size, Value);
} else if (auto *Fill = dyn_cast<MCFillFragment>(&Frag)) {
- DataBytes.insert(DataBytes.end(), Fill->getSize(), Fill->getValue());
+ int64_t Size;
+ if (!Fill->getSize().evaluateAsAbsolute(Size))
+ llvm_unreachable("The fill should be an assembler constant");
+ DataBytes.insert(DataBytes.end(), Size, Fill->getValue());
} else {
const auto &DataFrag = cast<MCDataFragment>(Frag);
const SmallVectorImpl<char> &Contents = DataFrag.getContents();