diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2021-10-07 14:04:54 +0000 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2021-10-07 16:34:10 +0200 |
| commit | 620352409e47ec27a68a97e08b5786e27035ce31 (patch) | |
| tree | 1b1fc530e32fe0a13053acf471e2c560f74a6a34 /prog/encodingexec_test.go | |
| parent | 62ee098758aa41a10767827625d32a871279eec9 (diff) | |
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.
Diffstat (limited to 'prog/encodingexec_test.go')
| -rw-r--r-- | prog/encodingexec_test.go | 11 |
1 files changed, 10 insertions, 1 deletions
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}, + }, }, }, }, |
