aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools/src
diff options
context:
space:
mode:
authorJosé Valim <[email protected]>2012-11-28 12:51:34 +0100
committerFredrik Gustafsson <[email protected]>2013-01-25 14:57:00 +0100
commit261880cfbebafddb61c728ed873f4e93107d9af9 (patch)
tree91f999d0924b3ec41e3fb486e34ab5fbcf9ad87e /lib/tools/src
parentf3fb48d42329d54b463e7434ff28bb51e4dde4dd (diff)
downloadotp-261880cfbebafddb61c728ed873f4e93107d9af9.tar.gz
otp-261880cfbebafddb61c728ed873f4e93107d9af9.tar.bz2
otp-261880cfbebafddb61c728ed873f4e93107d9af9.zip
Fix a bug in cover when used with no_auto_import
Cover was rewriting guard clauses as non-remote calls. That said, if a guard contains erlang:is_binary(Binary), Cover was incorrectly removing the erlang prefix which lead to errors if is_binary is not auto imported. This commit keeps the abstract format as it is.
Diffstat (limited to 'lib/tools/src')
-rw-r--r--lib/tools/src/cover.erl8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/tools/src/cover.erl b/lib/tools/src/cover.erl
index 3cf42662f8..2579711dc7 100644
--- a/lib/tools/src/cover.erl
+++ b/lib/tools/src/cover.erl
@@ -1799,17 +1799,11 @@ munge_expr({'catch',Line,Expr}, Vars) ->
{MungedExpr, Vars2} = munge_expr(Expr, Vars),
{{'catch',Line,MungedExpr}, Vars2};
munge_expr({call,Line1,{remote,Line2,ExprM,ExprF},Exprs},
- Vars) when Vars#vars.is_guard=:=false->
+ Vars) ->
{MungedExprM, Vars2} = munge_expr(ExprM, Vars),
{MungedExprF, Vars3} = munge_expr(ExprF, Vars2),
{MungedExprs, Vars4} = munge_exprs(Exprs, Vars3, []),
{{call,Line1,{remote,Line2,MungedExprM,MungedExprF},MungedExprs}, Vars4};
-munge_expr({call,Line1,{remote,_Line2,_ExprM,ExprF},Exprs},
- Vars) when Vars#vars.is_guard=:=true ->
- %% Difference in abstract format after preprocessing: BIF calls in guards
- %% are translated to {remote,...} (which is not allowed as source form)
- %% NOT NECESSARY FOR Vsn=raw_abstract_v1
- munge_expr({call,Line1,ExprF,Exprs}, Vars);
munge_expr({call,Line,Expr,Exprs}, Vars) ->
{MungedExpr, Vars2} = munge_expr(Expr, Vars),
{MungedExprs, Vars3} = munge_exprs(Exprs, Vars2, []),