]> git.lizzy.rs Git - plan9front.git/commit
games/mix: fix implementation of MOVE instruction (thanks nicolagi)
authorAlex Musolino <alex@musolino.id.au>
Fri, 27 Nov 2020 00:49:49 +0000 (11:19 +1030)
committerAlex Musolino <alex@musolino.id.au>
Fri, 27 Nov 2020 00:49:49 +0000 (11:19 +1030)
commit2a907fd4597d57d94fdf573f37c1d553318a7104
treea765f2e847839b40dbdb47c44e567258ea1a4a0b
parent781a8f8d9f50221dc34c0dab5baf48e197444269
games/mix: fix implementation of MOVE instruction (thanks nicolagi)

Plan 9 memcpy(2) uses the same implementation as memmove(2) to handle
overlapping ranges.  Hovewer, the MIX MOVE instruction, as described
in TAOCP, specifically does not do this.  It copies words one at a
time starting from the lowest address.

This change also expands the address validation to check that all
addresses within the source and destination ranges are valid before
proceeding.
sys/src/games/mix/mix.c