From c74aea420c662039072f606b2d5ef1c73426e481 Mon Sep 17 00:00:00 2001 From: Nakidai Date: Sat, 24 Aug 2024 14:29:55 +0300 Subject: Add more code Add some funcitons to work with variables, add more instructions and add ability to stop the code from `ccl_instruction` --- src/instruction/decrement.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/instruction/decrement.c') diff --git a/src/instruction/decrement.c b/src/instruction/decrement.c index f7f54dd..ce3af87 100644 --- a/src/instruction/decrement.c +++ b/src/instruction/decrement.c @@ -1,8 +1,11 @@ #include "3cl.h" -#include "instruction.h" + +#include "utils.h" struct CCLFrame *ccl_instruction_decrement(struct CCL *ccl, struct CCLFrame *frame) { + if (ccl->stack.cur < 1) + die(1, "stack size is %d (%d required)", ccl->stack.cur, 1); --ccl->stack.stack[ccl->stack.cur]; return frame; } -- cgit 1.4.1