commit 0f39b1c1051bda20bb00dc1806da7b7c116ebc9a
parent 68723241871601880b35701e8d07110f29575c44
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Tue, 25 Oct 2022 20:00:30 -0400
app/cos: fix misuse of move()
The "move" word can't move overlapping areas of memory when the source is
"lower" than the destination. Under the POSIX VM, it just so happens that the
implementation supports it, but not as designed. The i386 implementation of
move doesn't allow that.
This fixes the "LIST" word of Collapse OS under i386.
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/app/cos/cvm.c b/fs/app/cos/cvm.c
@@ -87,7 +87,9 @@ static void iowr_blk(byte val)
fread(&vm.mem[dest], 1024, blkfp);
}
} else {
- move(blkop, blkop+1, #[ BLKOP_CMD_SZ 1- c]# );
+ blkop[3] = blkop[2];
+ blkop[2] = blkop[1];
+ blkop[1] = blkop[0];
blkop[0] = val;
}
}