llvm.org GIT mirror llvm / 2854ea8
[WebAssembly] Read global index in init expression as LEB Subscribers: jfb, dschuff Differential Revision: https://reviews.llvm.org/D32462 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301330 91177308-0d34-0410-b5e6-96231b3b80d8 Sam Clegg 2 years ago
3 changed file(s) with 8 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
143143 Expr.Value.Float64 = readFloat64(Ptr);
144144 break;
145145 case wasm::WASM_OPCODE_GET_GLOBAL:
146 Expr.Value.Global = readUint32(Ptr);
146 Expr.Value.Global = readULEB128(Ptr);
147147 break;
148148 default:
149149 return make_error("Invalid opcode in init_expr",
293293 case wasm::WASM_OPCODE_F64_CONST:
294294 IO.mapRequired("Value", Expr.Value.Float64);
295295 break;
296 case wasm::WASM_OPCODE_GET_GLOBAL:
297 IO.mapRequired("Index", Expr.Value.Global);
298 break;
296299 }
297300 }
298301
1717 Functions:
1818 - 1
1919 - Offset:
20 Opcode: I32_CONST
21 Value: 5
20 Opcode: GET_GLOBAL
21 Index: 1
2222 Functions:
2323 - 4
2424 ...
3333 # CHECK: Value: 3
3434 # CHECK: Functions: [ 1 ]
3535 # CHECK: - Offset:
36 # CHECK: Opcode: I32_CONST
37 # CHECK: Value: 5
36 # CHECK: Opcode: GET_GLOBAL
37 # CHECK: Index: 1
3838 # CHECK: Functions: [ 4 ]
3939 # CHECK: ...