diff options
author | Björn Gustavsson <[email protected]> | 2019-02-15 09:56:20 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2019-02-15 09:56:20 +0100 |
commit | b4466ab778ae2278e29625d4b8220af3797fa3b6 (patch) | |
tree | 5dbb32a022aa76d71971e42c25e4173d74e1c16d /lib/compiler/src/v3_core.erl | |
parent | 11d4a893e50b1738b01846a5e669addb3e5a4f75 (diff) | |
parent | 595c159823089d0186ec2617c174356d1ff2de65 (diff) | |
download | otp-b4466ab778ae2278e29625d4b8220af3797fa3b6.tar.gz otp-b4466ab778ae2278e29625d4b8220af3797fa3b6.tar.bz2 otp-b4466ab778ae2278e29625d4b8220af3797fa3b6.zip |
Merge branch 'maint'
* maint:
Add persistent_term:get(Key, DefaultValue)
Make dialyzer faster for left-associative andalso/orelse expressions
Diffstat (limited to 'lib/compiler/src/v3_core.erl')
-rw-r--r-- | lib/compiler/src/v3_core.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/compiler/src/v3_core.erl b/lib/compiler/src/v3_core.erl index 34930c3afe..e2bcd25801 100644 --- a/lib/compiler/src/v3_core.erl +++ b/lib/compiler/src/v3_core.erl @@ -767,14 +767,16 @@ expr({op,_,'++',{lc,Llc,E,Qs0},More}, St0) -> {Qs,St2} = preprocess_quals(Llc, Qs0, St1), {Y,Yps,St} = lc_tq(Llc, E, Qs, Mc, St2), {Y,Mps++Yps,St}; -expr({op,L,'andalso',E1,E2}, St0) -> +expr({op,_,'andalso',_,_}=E0, St0) -> + {op,L,'andalso',E1,E2} = right_assoc(E0, 'andalso', St0), Anno = lineno_anno(L, St0), {#c_var{name=V0},St} = new_var(Anno, St0), V = {var,L,V0}, False = {atom,L,false}, E = make_bool_switch(L, E1, V, E2, False, St0), expr(E, St); -expr({op,L,'orelse',E1,E2}, St0) -> +expr({op,_,'orelse',_,_}=E0, St0) -> + {op,L,'orelse',E1,E2} = right_assoc(E0, 'orelse', St0), Anno = lineno_anno(L, St0), {#c_var{name=V0},St} = new_var(Anno, St0), V = {var,L,V0}, |