marekjm / viuavm

Parallel virtual machine designed to reliably run massively concurrent programs
https://viuavm.org/
GNU General Public License v3.0
71 stars 11 forks source link

Invalid semantics of register access in `vinsert` instruction #182

Closed marekjm closed 7 years ago

marekjm commented 7 years ago

As reported by @vktgz the semantics of register access by the last operand of the vinsert instruction are invalid.

Current (buggy) behaviour: if last operand accesses registers in the register-indirect mode it behaves as if plain mode was used, if plain mode is used the register index is treated as a literal integer.

Expected behaviour: index operand has the usual semantics for register-indirect and plain register access modes.

This behaviour is a result of the fact that in the beginning the last operand was a literal integer. But due to the move away from literals in non-constructor instructions, that has changed, but the change was badly implemented.

marekjm commented 7 years ago

Fixed by 255454995eedd9a91085f95be262062117acd810.