aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2014-03-11 00:39:21 +0100
committerBjörn-Egil Dahlberg <[email protected]>2014-03-18 14:39:28 +0100
commitca39d2c98507963f461adb78975e5adf35d6aafe (patch)
treeeeb6419e1ef637baae9608c4dbe08b3da5567304 /lib/compiler/src
parentaab1afa8a63081f2c30f83ebe8b6caaac979795c (diff)
downloadotp-ca39d2c98507963f461adb78975e5adf35d6aafe.tar.gz
otp-ca39d2c98507963f461adb78975e5adf35d6aafe.tar.bz2
otp-ca39d2c98507963f461adb78975e5adf35d6aafe.zip
Properly collect variables in map expressions in v3_core
Reported-by: José Valim
Diffstat (limited to 'lib/compiler/src')
-rw-r--r--lib/compiler/src/v3_core.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/compiler/src/v3_core.erl b/lib/compiler/src/v3_core.erl
index 082809b8a0..04210ae243 100644
--- a/lib/compiler/src/v3_core.erl
+++ b/lib/compiler/src/v3_core.erl
@@ -2206,6 +2206,8 @@ lit_vars(Lit) -> lit_vars(Lit, []).
lit_vars(#c_cons{hd=H,tl=T}, Vs) -> lit_vars(H, lit_vars(T, Vs));
lit_vars(#c_tuple{es=Es}, Vs) -> lit_list_vars(Es, Vs);
+lit_vars(#c_map{arg=V,es=Es}, Vs) -> lit_vars(V, lit_list_vars(Es, Vs));
+lit_vars(#c_map_pair{key=K,val=V}, Vs) -> lit_vars(K, lit_vars(V, Vs));
lit_vars(#c_var{name=V}, Vs) -> add_element(V, Vs);
lit_vars(_, Vs) -> Vs. %These are atomic