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/increment.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/instruction/increment.c') diff --git a/src/instruction/increment.c b/src/instruction/increment.c index 51697f1..d2d51a5 100644 --- a/src/instruction/increment.c +++ b/src/instruction/increment.c @@ -1,8 +1,11 @@ #include "3cl.h" -#include "instruction.h" + +#include "utils.h" struct CCLFrame *ccl_instruction_increment(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