On Sun, Mar 5, 2017 at 7:20 PM, Luc Van Oostenryck wrote: > Like for all others instructions, LLVM needs the type > of each operands. However this information is not always > available via the pseudo, like here when passing a integer > constant as argument since for sparse constants are typeless. > > Fix this by getting the type via the function prototype. > > + LLVMValueRef value; > + if (arg->type == PSEUDO_VAL) { > + /* Value pseudos do not have type information. */ > + /* Use the function prototype to get the type. */ > + struct symbol *ctype = get_nth1_arg(insn->func->sym, i + 1); I try to come up with an example to use the PREPARE_PTR_LIST() in this patch. I hit a bug "insn->func->sym" assume "insn->func" is a function symbol node. If "insn->func" is a function pointer then access "insn->func->sym" is wrong. Any way, my modify patch attached. It should work similar to this patch without using the nth argument help function. My limited test hit this function pointer bug. Chris