summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/WasmObjectWriter.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2019-09-25 23:33:16 +0000
committerSam Clegg <sbc@chromium.org>2019-09-25 23:33:16 +0000
commit079cba04bfa95f34d4b9e667f722ff6ebdf13ba6 (patch)
treeb15eaabfe61e3fa5542488bca2ab5c92e4013b75 /llvm/lib/MC/WasmObjectWriter.cpp
parentf8804047af8c397db804e5775009981d96db8fb4 (diff)
downloadbcm5719-llvm-079cba04bfa95f34d4b9e667f722ff6ebdf13ba6.tar.gz
bcm5719-llvm-079cba04bfa95f34d4b9e667f722ff6ebdf13ba6.zip
[MC][WebAssembly] Error on data symbols in the text section.
Previously we had an assert but this can actually occur in valid user code so we need to handle this in release builds too. Differential Revision: https://reviews.llvm.org/D67997 llvm-svn: 372934
Diffstat (limited to 'llvm/lib/MC/WasmObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/WasmObjectWriter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/MC/WasmObjectWriter.cpp b/llvm/lib/MC/WasmObjectWriter.cpp
index 53618887bb5..c1ff3cc2480 100644
--- a/llvm/lib/MC/WasmObjectWriter.cpp
+++ b/llvm/lib/MC/WasmObjectWriter.cpp
@@ -1350,7 +1350,9 @@ uint64_t WasmObjectWriter::writeObject(MCAssembler &Asm,
report_fatal_error(".size expression must be evaluatable");
auto &DataSection = static_cast<MCSectionWasm &>(WS.getSection());
- assert(DataSection.isWasmData());
+ if (!DataSection.isWasmData())
+ report_fatal_error("data symbols must live in a data section: " +
+ WS.getName());
// For each data symbol, export it in the symtab as a reference to the
// corresponding Wasm data segment.
OpenPOWER on IntegriCloud