aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2025-01-05 16:35:06 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2025-01-05 16:35:06 +0200
commitcb21b31b31dc30023d6fadcab3c15b258f40be9b (patch)
tree233d5b0703ecf0af04c8b58c961e10fd5ce20822
parent28c1822ec742ea0d469a3631115ed68507c1179e (diff)
downloadejit-cb21b31b31dc30023d6fadcab3c15b258f40be9b.tar.gz
ejit-cb21b31b31dc30023d6fadcab3c15b258f40be9b.zip
fix some assertions
-rw-r--r--src/ejit.c7
1 files changed, 4 insertions, 3 deletions
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);
}