Permalink
Browse files

Fix a bug in instr:transform_receive_case/1

When transforming receive clauses to case clauses,
we search for a `catchall' pattern and if we don't find one
then we add ours. But Concuerror doesn't check if a variable is
bound or unbound and falsely mistake them as a `catchall' rule.
For now, always add a `catchall' rule.
Many thanks to David Klaftenegger for pointing this bug.
  • Loading branch information...
1 parent fc8c523 commit 645ccee1a61dd1c33681544d5e02c8a4b2be0c04 @iliastsi iliastsi committed Sep 25, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/instr.erl
View
6 src/instr.erl
@@ -451,12 +451,12 @@ transform_receive_case(Clauses) ->
{erl_syntax:clause([Pattern], [], [NewBody]), NewHasCatchall}
end,
case lists:mapfoldl(Fun, false, Clauses) of
- {NewClauses, false} ->
+ {NewClauses, _HasCatchall} ->
Pattern = new_underscore_variable(),
Body = erl_syntax:atom(block),
CatchallClause = erl_syntax:clause([Pattern], [], [Body]),
- NewClauses ++ [CatchallClause];
- {NewClauses, true} -> NewClauses
+ NewClauses ++ [CatchallClause]
+%% {NewClauses, true} -> NewClauses
end.
transform_receive_clauses(Clauses) ->

0 comments on commit 645ccee

Please sign in to comment.