From d4c1d32e0aa21677e72c54ed220fdc70cea732c8 Mon Sep 17 00:00:00 2001
From: Kimplul <kimi.h.kuparinen@gmail.com>
Date: Sat, 29 Jun 2024 14:49:30 +0300
Subject: add flag for using 64 bit values on 32 machines

+ JIT backends needs to still trigger an assertion if we detect that the
  user lied
---
 src/compile/compile.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'src/compile')

diff --git a/src/compile/compile.c b/src/compile/compile.c
index c9a92a2..4ac68d3 100644
--- a/src/compile/compile.c
+++ b/src/compile/compile.c
@@ -522,8 +522,14 @@ static size_t compile_fn_body(struct ejit_func *f, jit_state_t *j, void *arena,
 	return size;
 }
 
-bool ejit_compile(struct ejit_func *f)
+bool ejit_compile(struct ejit_func *f, bool use_64)
 {
+	(void)use_64;
+#if __WORDSIZE == 32
+	/* can't compile 64bit code on 32bit systems, give up early */
+	if (use_64)
+		return false;
+#endif
 	if (!init_jit())
 		return false;
 
-- 
cgit v1.2.3