aboutsummaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2013-11-01 13:00:54 +0100
committerAnthony Ramine <[email protected]>2014-08-02 00:18:46 +0200
commit43f5d41c837ed28f4f7eb80c4796ed11a745bffe (patch)
tree4b5752655659303f1664ee5dc66193aaf0e9b165 /system
parent237264bc018b0cc17afeac5d3f6030073f314f9d (diff)
downloadotp-43f5d41c837ed28f4f7eb80c4796ed11a745bffe.tar.gz
otp-43f5d41c837ed28f4f7eb80c4796ed11a745bffe.tar.bz2
otp-43f5d41c837ed28f4f7eb80c4796ed11a745bffe.zip
Rewrite merge of clause variable tables (in case, try, etc)
erl_lint:icrt_export/4 has been rewritten to make the code really follow the scoping rules of Erlang, and not just in most situations by accident. * The function should not depend on calling unused_vars/3 because that function does not return variables which begins with an underscore, something that only matters when emitting warnings. This could cause a compiler crash if such a variable was reused afterwards. * The variable tables from each clause are first merged together, lists:merge/1 is safe to use because they are orddicts and thus already sorted. This list is then traversed parallelly to the old variable table, again taking advantage of their sorted order. * The function does not emit warnings itself, there is no need to pass around the lint state. In the same vein, vtunsafe/3 has been rewritten to do more things by itself, given that all of its calls were similar. Finally, compiled-out code has been removed. * This reverts the code in 9ce148b1059e4da746a11f1d80a653340216c468, which fixed the compiler crash and made erl_lint remember unsafe variables, but forget about unused variables in the process. * Other places of the code which relied on the old clunky behaviour were also updated: unused and unsafe old variables are forgotten when merging fun clauses and boolean shortcircuiting operators do not rely on icrt_export/3 anymore.
Diffstat (limited to 'system')
0 files changed, 0 insertions, 0 deletions