From 4d3970b3e045f1f85a3b9ec80b795e5e7ae605c8 Mon Sep 17 00:00:00 2001 From: crc <> Date: Thu, 13 Apr 2023 11:50:18 +0000 Subject: [PATCH] nga-c: add calls to stack guard function to remaining instructions (#96) FossilOrigin-Name: 1f94fdc0e964ebeae16c7a1ca3a314cb80059e282bf87a497762e8ad1d8611c4 --- vm/nga-c/retro.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vm/nga-c/retro.c b/vm/nga-c/retro.c index 3ff0d16..09d94bf 100644 --- a/vm/nga-c/retro.c +++ b/vm/nga-c/retro.c @@ -1339,6 +1339,7 @@ void inst_sh(NgaState *vm) { } void inst_zr(NgaState *vm) { + guard(vm, 1, 0, 0); if (TOS == 0) { inst_dr(vm); vm->cpu[vm->active].ip = TORS; @@ -1347,6 +1348,7 @@ void inst_zr(NgaState *vm) { } void inst_ha(NgaState *vm) { + guard(vm, 0, 0, 0); vm->cpu[vm->active].ip = IMAGE_SIZE; vm->cpu[vm->active].rp = 0; } @@ -1362,6 +1364,7 @@ void inst_iq(NgaState *vm) { } void inst_ii(NgaState *vm) { + guard(vm, 1, 0, 0); vm->IO_deviceHandlers[stack_pop(vm)](vm); }