From 620352409e47ec27a68a97e08b5786e27035ce31 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Thu, 7 Oct 2021 14:04:54 +0000 Subject: prog/decodeexec.go: properly handle call props before no-copyin calls If a call having non-default call props is followed by a call not having copyin instructions, the non-default call prop values will be lost. Fix this by trying to commit the call before processing the call props structure. Adjust the call-props-related decodeexec test to emulate that situation as well. --- prog/encodingexec_test.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'prog/encodingexec_test.go') diff --git a/prog/encodingexec_test.go b/prog/encodingexec_test.go index 4a8e5c7fd..5e0f73ce6 100644 --- a/prog/encodingexec_test.go +++ b/prog/encodingexec_test.go @@ -463,10 +463,14 @@ func TestSerializeForExec(t *testing.T) { nil, }, { - "test() (fail_nth: 3)", + `test() (fail_nth: 3) +test() (fail_nth: 4) +`, []uint64{ execInstrSetProps, 3, callID("test"), ExecNoCopyout, 0, + execInstrSetProps, 4, + callID("test"), ExecNoCopyout, 0, execInstrEOF, }, &ExecProg{ @@ -476,6 +480,11 @@ func TestSerializeForExec(t *testing.T) { Index: ExecNoCopyout, Props: CallProps{3}, }, + { + Meta: target.SyscallMap["test"], + Index: ExecNoCopyout, + Props: CallProps{4}, + }, }, }, }, -- cgit mrf-deployment