diff options
author | José Valim <[email protected]> | 2014-10-23 09:59:30 -0200 |
---|---|---|
committer | José Valim <[email protected]> | 2014-11-08 17:07:26 -0300 |
commit | b7740a6fe01d254d79291bbcbbc853e874eb41ef (patch) | |
tree | 9bc148e803ce6e4da79797dd967e7915555ac1f6 /lib/tools/src/cover.erl | |
parent | 8304aeb0114e61e8f694a58cf9e91a00856c3fe5 (diff) | |
download | otp-b7740a6fe01d254d79291bbcbbc853e874eb41ef.tar.gz otp-b7740a6fe01d254d79291bbcbbc853e874eb41ef.tar.bz2 otp-b7740a6fe01d254d79291bbcbbc853e874eb41ef.zip |
Fix cover bug on last expressions with empty clauses
OTP-8188 introduced a fix for handling last expressions in
expressions like case, try and friends. However the fix did
not account that some of those expressions like receive may
have no clauses (only an after clause), leading to a function
clause error when cover compiling code with such expressions.
Diffstat (limited to 'lib/tools/src/cover.erl')
-rw-r--r-- | lib/tools/src/cover.erl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/tools/src/cover.erl b/lib/tools/src/cover.erl index 113fa24bd5..31754015f7 100644 --- a/lib/tools/src/cover.erl +++ b/lib/tools/src/cover.erl @@ -1696,6 +1696,8 @@ fix_expr(T, Line, Bump) when is_tuple(T) -> fix_expr(E, _Line, _Bump) -> E. +fix_clauses([], _Line, _Bump) -> + []; fix_clauses(Cs, Line, Bump) -> case bumps_line(lists:last(Cs), Line) of true -> |