support for builtin functions with 0 args

This commit is contained in:
r4
2021-12-23 22:25:41 +01:00
parent ca232fbf6a
commit 9bd4d4e0c4
2 changed files with 37 additions and 26 deletions

2
ir.c
View File

@@ -43,7 +43,7 @@ void irtoks_init_short(IRToks *v) {
void irtoks_term(IRToks *v) {
for (size_t i = 0; i < v->len; i++) {
if (v->toks[i].instr == IRCallInternal)
if (v->toks[i].instr == IRCallInternal && v->toks[i].CallI.args)
free(v->toks[i].CallI.args);
}
free(v->toks);