Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix counting of arguments of closures

Do not rely on MFA name for the arity of functions, since closures have
an extra argument. Instead, just use the length of the arguments list.
  • Loading branch information...
commit 4350be1839f6e9b2c525727ce9eb69a3f9ce0d5c 1 parent 87a01aa
@cstavr cstavr authored committed
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/hipe/llvm/hipe_rtl_to_llvm.erl
View
9 lib/hipe/llvm/hipe_rtl_to_llvm.erl
@@ -430,12 +430,13 @@ trans_call_name(RtlCallName, Relocs, CallArgs, FinalArgs) ->
case RtlCallName of
PrimOp when is_atom(PrimOp) ->
LlvmName = trans_prim_op(PrimOp),
- Relocs1 = relocs_store(LlvmName, {call, {bif, PrimOp, length(CallArgs)}},
- Relocs),
+ Relocs1 =
+ relocs_store(LlvmName, {call, {bif, PrimOp, length(CallArgs)}}, Relocs),
{"@" ++ LlvmName, [], Relocs1};
{M, F, A} when is_atom(M), is_atom(F), is_integer(A) ->
- LlvmName = trans_mfa_name({M,F,A}),
- Relocs1 = relocs_store(LlvmName, {call, {M,F,A}}, Relocs),
+ LlvmName = trans_mfa_name({M, F, A}),
+ Relocs1 =
+ relocs_store(LlvmName, {call, {M, F, length(CallArgs)}}, Relocs),
{"@" ++ LlvmName, [], Relocs1};
Reg ->
case hipe_rtl:is_reg(Reg) of
Please sign in to comment.
Something went wrong with that request. Please try again.