diff options
author | Björn Gustavsson <[email protected]> | 2014-01-09 12:00:45 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2014-01-09 12:00:45 +0100 |
commit | 31ecc95ef55de3e112fd0b5134366fccf742a92d (patch) | |
tree | d7884fb5b00a63e812633904fff811c0c5bddd2e /lib/debugger/src/dbg_ieval.erl | |
parent | e086297a8638a9f57983fd707f6c75e3d4b6edf3 (diff) | |
parent | 146b9548d6d6dac3753ef6eeeebe266033c4d66a (diff) | |
download | otp-31ecc95ef55de3e112fd0b5134366fccf742a92d.tar.gz otp-31ecc95ef55de3e112fd0b5134366fccf742a92d.tar.bz2 otp-31ecc95ef55de3e112fd0b5134366fccf742a92d.zip |
Merge branch 'nox/fix-dbg_ieval-exporting-rules/OTP-11553'
* nox/fix-dbg_ieval-exporting-rules/OTP-11553:
compiler tests: Test exporting rules for andalso/orelse
Fix evaluation of andalso and orelse in the debugger
Diffstat (limited to 'lib/debugger/src/dbg_ieval.erl')
-rw-r--r-- | lib/debugger/src/dbg_ieval.erl | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/lib/debugger/src/dbg_ieval.erl b/lib/debugger/src/dbg_ieval.erl index 6ce3262ed2..14a17fe304 100644 --- a/lib/debugger/src/dbg_ieval.erl +++ b/lib/debugger/src/dbg_ieval.erl @@ -712,23 +712,25 @@ expr({'if',Line,Cs}, Bs, Ieval) -> if_clauses(Cs, Bs, Ieval#ieval{line=Line}); %% Andalso/orelse -expr({'andalso',Line,E1,E2}, Bs, Ieval) -> - case expr(E1, Bs, Ieval#ieval{line=Line, top=false}) of - {value,false,_}=Res -> - Res; - {value,true,_} -> - expr(E2, Bs, Ieval#ieval{line=Line, top=false}); - {value,Val,Bs} -> - exception(error, {badarg,Val}, Bs, Ieval) +expr({'andalso',Line,E1,E2}, Bs0, Ieval) -> + case expr(E1, Bs0, Ieval#ieval{line=Line, top=false}) of + {value,false,_}=Res -> + Res; + {value,true,Bs} -> + {value,Val,_} = expr(E2, Bs, Ieval#ieval{line=Line, top=false}), + {value,Val,Bs}; + {value,Val,Bs} -> + exception(error, {badarg,Val}, Bs, Ieval) end; -expr({'orelse',Line,E1,E2}, Bs, Ieval) -> - case expr(E1, Bs, Ieval#ieval{line=Line, top=false}) of - {value,true,_}=Res -> - Res; - {value,false,_} -> - expr(E2, Bs, Ieval#ieval{line=Line, top=false}); - {value,Val,_} -> - exception(error, {badarg,Val}, Bs, Ieval) +expr({'orelse',Line,E1,E2}, Bs0, Ieval) -> + case expr(E1, Bs0, Ieval#ieval{line=Line, top=false}) of + {value,true,_}=Res -> + Res; + {value,false,Bs} -> + {value,Val,_} = expr(E2, Bs, Ieval#ieval{line=Line, top=false}), + {value,Val,Bs}; + {value,Val,Bs} -> + exception(error, {badarg,Val}, Bs, Ieval) end; %% Matching expression |