diff options
author | Björn Gustavsson <[email protected]> | 2014-02-04 09:19:39 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2014-02-04 10:19:55 +0100 |
commit | 5d1471fae699fed9318ea6cad939156c2775d8be (patch) | |
tree | 32723185e8a5a69210fe41a1e3dc7ec721a7c9de /lib/observer/src/etop.erl | |
parent | f7663318a618d7f18f0c1aa07a023f3f7353c0af (diff) | |
download | otp-5d1471fae699fed9318ea6cad939156c2775d8be.tar.gz otp-5d1471fae699fed9318ea6cad939156c2775d8be.tar.bz2 otp-5d1471fae699fed9318ea6cad939156c2775d8be.zip |
sys_core_fold: Prevent case expressions from being evaluated twice
In e12b7d5331c58b41db06cadfa4af75b78b62a2b1, a bug was introduced
that would cause case expressions to be evaluated more than once
if there were aliases in the pattern. Example:
X = Y = io:put_chars("some chars"),
{X,Y}
That would be rewritten to code similar to (but in Core Erlang):
X = io:put_chars("some chars"),
X = io:put_chars("some chars"),
{X,Y}
Make sure that we only evalute the expression once by doing a
transformation similar to (but in Core Erlang):
NewVar = io:put_chars("some chars"),
X = NewVar,
Y = NewVar,
{X,Y}
Reported-by: José Valim
Reported-by: Anthony Ramine
Diffstat (limited to 'lib/observer/src/etop.erl')
0 files changed, 0 insertions, 0 deletions