Browse Source

Correct #c_vararg behaviour on -llvm-api

gingerBill 4 years ago
parent
commit
0007ac63ed
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/llvm_backend.cpp

+ 6 - 0
src/llvm_backend.cpp

@@ -1331,6 +1331,9 @@ LLVMTypeRef lb_type_internal(lbModule *m, Type *type) {
 					if (e->kind != Entity_Variable) {
 						continue;
 					}
+					if (e->flags & EntityFlag_CVarArg) {
+						continue;
+					}
 					param_count += 1;
 				}
 			}
@@ -1359,6 +1362,9 @@ LLVMTypeRef lb_type_internal(lbModule *m, Type *type) {
 					if (e->kind != Entity_Variable) {
 						continue;
 					}
+					if (e->flags & EntityFlag_CVarArg) {
+						continue;
+					}
 
 					Type *e_type = reduce_tuple_to_single_type(e->type);