Skip to content

Commit 965f574

Browse files
committed
Fix internal compiler error with function call casts
Handle function call casts in a similar way whether the name is a function identifier or a function pointer.
1 parent 1345041 commit 965f574

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/flang2/flang2exe/cgmain.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6852,7 +6852,7 @@ gen_call_expr(int ilix, DTYPE ret_dtype, INSTR_LIST *call_instr, int call_sptr)
68526852
LL_ABI_Info *abi;
68536853
LL_Type *return_type;
68546854
OPERAND *first_arg_op;
6855-
OPERAND *callee_op;
6855+
OPERAND *callee_op = NULL;
68566856
LL_Type *func_type = NULL;
68576857
OPERAND *result_op = NULL;
68586858
bool contains_x86_mmx = false;
@@ -6937,7 +6937,9 @@ gen_call_expr(int ilix, DTYPE ret_dtype, INSTR_LIST *call_instr, int call_sptr)
69376937
/* Indirect call: JSRA addr arg-lnk flags */
69386938
int addr_ili = ILI_OPND(ilix, 1);
69396939
if (!func_type) {
6940-
func_type = ll_abi_function_type(abi);
6940+
func_type = abi->is_varargs ? ll_abi_function_type(abi) :
6941+
make_function_type_from_args(
6942+
ll_abi_return_type(abi), first_arg_op, abi->call_as_varargs);
69416943
}
69426944
/* Now that we know the desired type we can create the callee address
69436945
expression. */

0 commit comments

Comments
 (0)