Don't let this end in SEGV, due to the subsequent NULL deref. Signed-off-by: Jan Beulich <jbeul...@suse.com>
--- a/tools/tests/x86_emulator/predicates.c +++ b/tools/tests/x86_emulator/predicates.c @@ -2189,6 +2189,13 @@ void do_test(uint8_t *instr, unsigned in { s = x86_decode_insn(ctxt, fetch); + if ( !s ) + { + print_insn(instr, len); + printf(" failed to decode\n"); + return; + } + if ( x86_insn_length(s, ctxt) != len ) { print_insn(instr, len); @@ -2218,6 +2225,13 @@ void do_test(uint8_t *instr, unsigned in s = x86_decode_insn(ctxt, fetch); + if ( !s ) + { + print_insn(instr, len); + printf(" failed to decode\n"); + return; + } + if ( x86_insn_length(s, ctxt) != len ) { print_insn(instr, len);