commit 5bb54c0c87eecb216dd61baab88ff6b86994b8b5
parent 4c835bdde89fbd1cd8c6e18f13b5102c1096266b
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Wed, 7 Sep 2022 15:20:55 -0400
cvm: don't bypass emit in rtype
Previously, rtype printed directly to stdout in the CVM kernel, but this
prevented output redirection through re-aliasing emit.
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/posix/vm.c b/posix/vm.c
@@ -540,7 +540,10 @@ static void RTYPE() { // op: 4e
dword u = ppop();
dword a = ppop();
if (memchk(a+u)) {
- write(STDOUT_FILENO, &vm.mem[a], u);
+ for (int i=0; i<u; i++) {
+ ppush(vm.mem[a+i]);
+ callword(gd(EMIT));
+ }
}
}