aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/WasmObjectFile.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2025-02-04 14:06:07 -0800
committerGitHub <noreply@github.com>2025-02-04 14:06:07 -0800
commitc798a5c4d5c3c8cb21e6001f505d8f44217c2244 (patch)
treed3ec2ed4d6aed69c374d7b5099b9adf15ddf16d7 /llvm/lib/Object/WasmObjectFile.cpp
parent692db7403b4ad10311b7e8c85a0fc7de5bc32017 (diff)
downloadllvm-c798a5c4d5c3c8cb21e6001f505d8f44217c2244.zip
llvm-c798a5c4d5c3c8cb21e6001f505d8f44217c2244.tar.gz
llvm-c798a5c4d5c3c8cb21e6001f505d8f44217c2244.tar.bz2
[Object][WebAssembly] Fix data segment offsets higher than 2^31 (#125739)
Fixes: #58555
Diffstat (limited to 'llvm/lib/Object/WasmObjectFile.cpp')
-rw-r--r--llvm/lib/Object/WasmObjectFile.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp
index 0f6fd56..7815c26 100644
--- a/llvm/lib/Object/WasmObjectFile.cpp
+++ b/llvm/lib/Object/WasmObjectFile.cpp
@@ -201,10 +201,10 @@ static Error readInitExpr(wasm::WasmInitExpr &Expr,
Expr.Inst.Opcode = readOpcode(Ctx);
switch (Expr.Inst.Opcode) {
case wasm::WASM_OPCODE_I32_CONST:
- Expr.Inst.Value.Int32 = readVarint32(Ctx);
+ Expr.Inst.Value.Int32 = readVaruint32(Ctx);
break;
case wasm::WASM_OPCODE_I64_CONST:
- Expr.Inst.Value.Int64 = readVarint64(Ctx);
+ Expr.Inst.Value.Int64 = readVaruint64(Ctx);
break;
case wasm::WASM_OPCODE_F32_CONST:
Expr.Inst.Value.Float32 = readFloat32(Ctx);