aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/llvm
diff options
context:
space:
mode:
authorChristos Stavrakakis <[email protected]>2014-03-30 21:34:05 +0300
committerYiannis Tsiouris <[email protected]>2014-03-30 23:21:12 +0300
commit4350be1839f6e9b2c525727ce9eb69a3f9ce0d5c (patch)
treeae340599dc50977288f63a104f1da63cd4723c32 /lib/hipe/llvm
parent87a01aa0c1a32f821e2f6305b70ee83faa0890f0 (diff)
downloadotp-4350be1839f6e9b2c525727ce9eb69a3f9ce0d5c.tar.gz
otp-4350be1839f6e9b2c525727ce9eb69a3f9ce0d5c.tar.bz2
otp-4350be1839f6e9b2c525727ce9eb69a3f9ce0d5c.zip
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.
Diffstat (limited to 'lib/hipe/llvm')
-rw-r--r--lib/hipe/llvm/hipe_rtl_to_llvm.erl9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/hipe/llvm/hipe_rtl_to_llvm.erl b/lib/hipe/llvm/hipe_rtl_to_llvm.erl
index ba76e1d815..d7d8d1b049 100644
--- a/lib/hipe/llvm/hipe_rtl_to_llvm.erl
+++ b/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