summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r--llvm/lib/MC/WasmObjectWriter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/MC/WasmObjectWriter.cpp b/llvm/lib/MC/WasmObjectWriter.cpp
index 0f0b645492e..782479e2651 100644
--- a/llvm/lib/MC/WasmObjectWriter.cpp
+++ b/llvm/lib/MC/WasmObjectWriter.cpp
@@ -492,9 +492,9 @@ uint32_t
WasmObjectWriter::getProvisionalValue(const WasmRelocationEntry &RelEntry) {
const MCSymbolWasm *Sym = ResolveSymbol(*RelEntry.Symbol);
- // For undefined symbols, use a hopefully invalid value.
+ // For undefined symbols, use zero
if (!Sym->isDefined(/*SetUsed=*/false))
- return UINT32_MAX;
+ return 0;
uint32_t GlobalIndex = SymbolIndices[Sym];
const WasmGlobal& Global = Globals[GlobalIndex - NumGlobalImports];
OpenPOWER on IntegriCloud