fix bug with varable arg funcs

This commit is contained in:
2026-05-11 21:14:28 +10:00
parent 0d2cd86b85
commit c6ce89b06b

View File

@@ -1820,8 +1820,7 @@ ResultType(CometValue, charptr) visitFuncCall(CometCompiler* compiler, CometASTN
return arg;
// wrong type passed to function
printf("%d %d\n", paramCount, i);
if (arg.as.success.type != paramTypes[i]) {
if (i < paramCount && arg.as.success.type != paramTypes[i]) {
ResultType(LLVMValueRef, charptr) castedArg = castToType(compiler, arg.as.success.value, paramTypes[i]);
if (castedArg.error) {