Skip to content

Commit 4841577

Browse files
authored
Revert "[Object][WebAssembly] Fix data segment offsets higher than 2^31 (#125739)" (#125786)
This reverts commit c798a5c. This broke bunch of test the emscripten side. Reverting while we investigate.
1 parent 4055be5 commit 4841577

File tree

5 files changed

+6
-46
lines changed

5 files changed

+6
-46
lines changed

llvm/include/llvm/BinaryFormat/Wasm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ struct WasmTable {
333333
struct WasmInitExprMVP {
334334
uint8_t Opcode;
335335
union {
336-
uint32_t Int32;
337-
uint64_t Int64;
336+
int32_t Int32;
337+
int64_t Int64;
338338
uint32_t Float32;
339339
uint64_t Float64;
340340
uint32_t Global;

llvm/lib/Object/WasmObjectFile.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@ static Error readInitExpr(wasm::WasmInitExpr &Expr,
201201
Expr.Inst.Opcode = readOpcode(Ctx);
202202
switch (Expr.Inst.Opcode) {
203203
case wasm::WASM_OPCODE_I32_CONST:
204-
Expr.Inst.Value.Int32 = readVaruint32(Ctx);
204+
Expr.Inst.Value.Int32 = readVarint32(Ctx);
205205
break;
206206
case wasm::WASM_OPCODE_I64_CONST:
207-
Expr.Inst.Value.Int64 = readVaruint64(Ctx);
207+
Expr.Inst.Value.Int64 = readVarint64(Ctx);
208208
break;
209209
case wasm::WASM_OPCODE_F32_CONST:
210210
Expr.Inst.Value.Float32 = readFloat32(Ctx);

llvm/test/Object/Wasm/data-offsets.yaml

Lines changed: 0 additions & 22 deletions
This file was deleted.

llvm/test/ObjectYAML/wasm/global_section.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Sections:
1010
Mutable: false
1111
InitExpr:
1212
Opcode: I64_CONST
13-
Value: 5
13+
Value: -5
1414
...
1515
# CHECK: --- !WASM
1616
# CHECK: FileHeader:
@@ -23,5 +23,5 @@ Sections:
2323
# CHECK: Mutable: false
2424
# CHECK: InitExpr:
2525
# CHECK: Opcode: I64_CONST
26-
# CHECK: Value: 5
26+
# CHECK: Value: -5
2727
# CHECK: ...

llvm/test/ObjectYAML/wasm/invalidate_data_offset.yaml

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)