diff options
author | Luis Rascao <[email protected]> | 2015-10-10 15:52:40 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2016-02-03 09:07:52 +0100 |
commit | 543330e6b1da49f022bf1541a01bb3a87a8c9e9c (patch) | |
tree | ad50cb5ffd9916283dd020c1967af281f857d8ee | |
parent | 876af25b600bf698cac95cd1902fa16aeecc0c7e (diff) | |
download | otp-543330e6b1da49f022bf1541a01bb3a87a8c9e9c.tar.gz otp-543330e6b1da49f022bf1541a01bb3a87a8c9e9c.tar.bz2 otp-543330e6b1da49f022bf1541a01bb3a87a8c9e9c.zip |
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.
-rw-r--r-- | lib/tools/src/cover.erl | 2 |
1 files changed, 1 insertions, 1 deletions
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}; |