+2019-04-29 John Darrington <john@darrington.wattle.id.au>
+
+ * testsuite/gas/s12z/truncated.d: New file.
+ * testsuite/gas/s12z/truncated.s: New file.
+ * testsuite/gas/s12z/s12z.exp: Add new test.
+
2019-04-26 Andrew Bennett <andrew.bennett@imgtec.com>
Faraz Shahbazker <fshahbazker@wavecomp.com>
run_dump_test ext24-ld-xy
run_dump_test st-xy
run_dump_test bit-manip-invalid
+run_dump_test truncated
# Symbol related tests
run_dump_test opr-symbol
--- /dev/null
+#objdump: -d
+#name: Handle truncated instruction gracefully.
+#source: truncated.s
+
+
+.*: file format elf32-s12z
+
+
+Disassembly of section .text:
+
+00000000 <.text>:
+ 0: 01 nop
+ 1: Address 0x0000000000000002 is out of bounds.
+Address 0x0000000000000002 is out of bounds.
+Address 0x0000000000000002 is out of bounds.
+!!invalid!!
+
--- /dev/null
+ nop
+ ;; This is a valid start of an instruction. But it stops in the middle.
+ dc.b 0x14
+2019-04-29 John Darrington <john@darrington.wattle.id.au>
+
+ * s12z-opc.c (shift_discrim): Return OP_INVALID when reading fails.
+
2019-04-26 Andrew Bennett <andrew.bennett@imgtec.com>
Faraz Shahbazker <fshahbazker@wavecomp.com>
uint8_t sb;
int status = mra->read (mra, 0, 1, &sb);
if (status < 0)
- return status;
+ return OP_INVALID;
enum SB_DIR dir = (sb & 0x40) ? SB_LEFT : SB_RIGHT;
enum SB_TYPE type = (sb & 0x80) ? SB_ARITHMETIC : SB_LOGICAL;