diff --git a/test/contracts/answer-locals/answer-locals.wat b/test/contracts/answer-locals/answer-locals.wat index bce27995f..02ad07671 100644 --- a/test/contracts/answer-locals/answer-locals.wat +++ b/test/contracts/answer-locals/answer-locals.wat @@ -2,12 +2,14 @@ (type (;0;) (func (param i64))) (type (;1;) (func)) (import "env" "int64finish" (func (;0;) (type 0))) - (func (;1;) (type 1) - (local i64 i64 i64 i64 i64) + (func (;1;) (type 1)) + (func (;2;) (type 1) + (local i64 i64 i64 i64) i64.const 42 call 0) (table (;0;) 1 1 funcref) (memory (;0;) 2) (global (;0;) (mut i32) (i32.const 66560)) (export "memory" (memory 0)) - (export "init" (func 1))) + (export "init" (func 1)) + (export "answer" (func 2))) diff --git a/test/contracts/answer-locals/output/answer-locals.wasm b/test/contracts/answer-locals/output/answer-locals.wasm index 218810b1d..b6b8d92dc 100644 Binary files a/test/contracts/answer-locals/output/answer-locals.wasm and b/test/contracts/answer-locals/output/answer-locals.wasm differ diff --git a/vmhost/hosttest/execution_test.go b/vmhost/hosttest/execution_test.go index cec126041..fc74f012f 100644 --- a/vmhost/hosttest/execution_test.go +++ b/vmhost/hosttest/execution_test.go @@ -3687,8 +3687,9 @@ func TestExecution_Mocked_OnSameFollowedByOnDest(t *testing.T) { // number of i64 locals it instantiates func makeBytecodeWithLocals(numLocals uint64) []byte { originalCode := test.GetTestSCCode("answer-locals", "../../") - firstSlice := originalCode[:0x59] - secondSlice := originalCode[0x5A:] + + firstSlice := originalCode[:0x66] + secondSlice := originalCode[0x67:] encodedNumLocals := vmhost.U64ToLEB128(numLocals) extraBytes := len(encodedNumLocals) - 1 @@ -3698,8 +3699,8 @@ func makeBytecodeWithLocals(numLocals uint64) []byte { result = append(result, encodedNumLocals...) result = append(result, secondSlice...) - result[0x55] = byte(int(result[0x55]) + extraBytes) - result[0x57] = byte(int(result[0x57]) + extraBytes) + result[0x5F] = byte(int(result[0x5F]) + extraBytes) + result[0x64] = byte(int(result[0x64]) + extraBytes) return result }