aboutsummaryrefslogtreecommitdiffhomepage
path: root/ir.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2023-05-26 09:20:58 +0200
committerlemon <lsof@mailbox.org>2023-05-26 09:20:58 +0200
commit640a3dac2b18d037169af15dfd5502c386c7e828 (patch)
tree79e7ee3fa81e73855ce1bc78d7c4bf1ad3ac8f0d /ir.c
parent9100ed2b5dd01df8e6b766c7bc2a12c0dd44f1ff (diff)
hm
Diffstat (limited to 'ir.c')
-rw-r--r--ir.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ir.c b/ir.c
index 2cb1783..9812f21 100644
--- a/ir.c
+++ b/ir.c
@@ -24,11 +24,11 @@ irinit(struct function *fn)
}
type2cls[TYFLOAT] = KF4;
type2cls[TYDOUBLE] = KF8;
- type2cls[TYPTR] = KIP;
- type2cls[TYARRAY] = KIP;
+ type2cls[TYPTR] = KPTR;
+ type2cls[TYARRAY] = KPTR;
cls2siz[KI4] = cls2siz[KF4] = 4;
cls2siz[KI8] = cls2siz[KF8] = 8;
- cls2siz[KIP] = targ_primsizes[TYPTR];
+ cls2siz[KPTR] = targ_primsizes[TYPTR];
}
fn->entry = fn->curblk = alloc(&fn->arena, sizeof(struct block), 0);
fn->entry->lprev = fn->entry->lnext = fn->entry;
@@ -154,7 +154,7 @@ mkfltcon(struct function *fn, enum irclass k, double f)
union irref
mksymref(struct function *fn, const char *s)
{
- struct xcon con = { 1, KIP, .sym = s };
+ struct xcon con = { 1, KPTR, .sym = s };
return mkref(RXCON, addcon(&con));
}
@@ -164,7 +164,7 @@ mkcall(struct function *fn, union type fnty, uint narg, union irref *args, union
const struct typedata *td = &typedata[fnty.dat];
struct ircall call = { narg, td->variadic ? td->nmemb : -1 };
- assert(td->variadic ? narg >= td->nmemb : narg == td->nmemb);
+ if (!td->kandr) assert(td->variadic ? narg >= td->nmemb : narg == td->nmemb);
if (narg) {
call.args = alloc(&fn->arena, narg*sizeof *args + narg*sizeof(union irtype), 0);
call.typs = (union irtype *)((char *)call.args + narg*sizeof *args);