DavidKinder / Inform6

The latest version of the Inform 6 compiler, used for generating interactive fiction games.
http://inform-fiction.org/
Other
199 stars 32 forks source link

Fix the argument parsing of the @jump opcode #266

Closed erkyrath closed 5 months ago

erkyrath commented 5 months ago

When parsing Z-code assembly, for the @jump opcode, parse the argument with parse_label() instead of parse_operand().

This brings @jump in line with the jump statement. It correctly supports forward and backward jumps; it throws the correct error when jumping to a nonexistent label.

(Apparently the @jump opcode was just never tested at all for Z-code assembly. Everybody's been using the statement form, which produces the same output, only without the bugs.)

This entirely fixes https://github.com/DavidKinder/Inform6/issues/200 as far as I know.

Test cases: https://github.com/erkyrath/Inform6-Testing/blob/jump-opcode/src/jumpopcodetest.inf , https://github.com/erkyrath/Inform6-Testing/blob/jump-opcode/src/jumpbadtest.inf .