From 2a2d096b61262c2059ea022379869b9c4a70eafa Mon Sep 17 00:00:00 2001
From: Kimplul <kimi.h.kuparinen@gmail.com>
Date: Fri, 14 Mar 2025 22:33:57 +0200
Subject: protect jit pages

---
 examples/fib.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'examples/fib.c')

diff --git a/examples/fib.c b/examples/fib.c
index 308ecd1..999546b 100644
--- a/examples/fib.c
+++ b/examples/fib.c
@@ -3,7 +3,7 @@
 
 #include "../include/ejit/ejit.h"
 
-struct ejit_func *compile(bool try_jit)
+struct ejit_func *compile(bool try_jit, bool im_scawed)
 {
 	struct ejit_operand args[1] = {
 		EJIT_OPERAND_GPR(0, EJIT_INT32) /* loc 0 contains n */
@@ -34,7 +34,7 @@ struct ejit_func *compile(bool try_jit)
 	/* the highest location we used was 1, so we need to request 2 locations
 	 * for general purpose registers in total. No floating point registers,
 	 * so 0. */
-	ejit_select_compile_func(f, 2, 0, EJIT_USE64(int32_t), try_jit);
+	ejit_select_compile_func(f, 2, 0, EJIT_USE64(int32_t), try_jit, im_scawed);
 	return f;
 }
 
@@ -45,13 +45,13 @@ int main(int argc, char *argv[])
 		return -1;
 	}
 
-	int try_jit = strtoull(argv[3], 0, 0);
+	int jit_level = strtoull(argv[3], 0, 0);
 	size_t compile_num = strtoull(argv[1], 0, 0);
 	struct ejit_func **info = calloc(compile_num, sizeof(struct ejit_func *));
 
 	clock_t t = clock();
 	for(size_t i = 0; i < compile_num; ++i){
-		info[i] = compile(try_jit);
+		info[i] = compile(jit_level > 0, jit_level > 1);
 	}
 	t = clock() - t;
 
-- 
cgit v1.2.3