From cb21b31b31dc30023d6fadcab3c15b258f40be9b Mon Sep 17 00:00:00 2001
From: Kimplul <kimi.h.kuparinen@gmail.com>
Date: Sun, 5 Jan 2025 16:35:06 +0200
Subject: fix some assertions

---
 src/ejit.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'src')

diff --git a/src/ejit.c b/src/ejit.c
index c202c7a..cfbbbc1 100644
--- a/src/ejit.c
+++ b/src/ejit.c
@@ -1263,7 +1263,7 @@ int64_t ejit_run_interp(struct ejit_func *f, size_t argc,
 		     void ***labels_wb)
 {
 	if (run) {
-		assert(f->gpr && "trying to run a function that hasn't been compiled");
+		assert(f->size && "trying to run a function that hasn't been compiled");
 		assert(f->rtype == EJIT_VOID || ejit_int_type(f->rtype));
 		if (f->arena)
 			return ((ejit_escape_t)f->arena)(argc, args);
@@ -1281,8 +1281,9 @@ double ejit_run_interp_f(struct ejit_func *f, size_t argc,
 		     void ***labels_wb)
 {
 	if (run) {
-		assert(f->gpr && "trying to run a function that hasn't been compiled");
-		assert(f->rtype == EJIT_VOID || ejit_int_type(f->rtype));
+		assert(f->size && "trying to run a function that hasn't been compiled");
+		/* void functions should use ejit_run_interp */
+		assert(ejit_float_type(f->rtype));
 		if (f->arena)
 			return ((ejit_escape_f_t)f->arena)(argc, args);
 	}
-- 
cgit v1.2.3