From 543330e6b1da49f022bf1541a01bb3a87a8c9e9c Mon Sep 17 00:00:00 2001 From: Luis Rascao Date: Sat, 10 Oct 2015 15:52:40 +0100 Subject: tools: Fix wrong instrumentation of binary comprehensions When cover instruments binary comprehensions it's generating a {block, ...} abstract code term inside a {bc, ...} term that is causing the evaluation to fail at runtime. Removing the block statement eliminates the error. The template of a bit string comprehension cannot have a counter since it is not allowed to be a block. --- lib/tools/src/cover.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/tools/src/cover.erl') diff --git a/lib/tools/src/cover.erl b/lib/tools/src/cover.erl index 0ae5c7978d..d16ca7f406 100644 --- a/lib/tools/src/cover.erl +++ b/lib/tools/src/cover.erl @@ -2005,7 +2005,7 @@ munge_expr({lc,Line,Expr,Qs}, Vars) -> {{lc,Line,MungedExpr,MungedQs}, Vars3}; munge_expr({bc,Line,Expr,Qs}, Vars) -> {bin,BLine,[{bin_element,EL,Val,Sz,TSL}|Es]} = Expr, - Expr2 = {bin,BLine,[{bin_element,EL,?BLOCK1(Val),Sz,TSL}|Es]}, + Expr2 = {bin,BLine,[{bin_element,EL,Val,Sz,TSL}|Es]}, {MungedExpr,Vars2} = munge_expr(Expr2, Vars), {MungedQs, Vars3} = munge_qualifiers(Qs, Vars2), {{bc,Line,MungedExpr,MungedQs}, Vars3}; -- cgit v1.2.3