aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-04-21 08:37:24 +0200
committerBjörn Gustavsson <[email protected]>2015-04-23 13:44:03 +0200
commit94a33dfb4becbf5ce4da487ac50cfa9d9d760708 (patch)
treeb3c0fbead5892ac05818a9ea65ceb57d26638692 /lib/compiler/src
parent7effd4c9efc42d7afcef6390d18617e7e97275e6 (diff)
downloadotp-94a33dfb4becbf5ce4da487ac50cfa9d9d760708.tar.gz
otp-94a33dfb4becbf5ce4da487ac50cfa9d9d760708.tar.bz2
otp-94a33dfb4becbf5ce4da487ac50cfa9d9d760708.zip
beam_validator: Correct merging of states
When merging two states, the following fields should be merged between the states: #st.x, #st.y, #st.numy, #st.ct. Everything else should be set to the default values in a new state.
Diffstat (limited to 'lib/compiler/src')
-rw-r--r--lib/compiler/src/beam_validator.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/compiler/src/beam_validator.erl b/lib/compiler/src/beam_validator.erl
index ed94880d38..d642bf9867 100644
--- a/lib/compiler/src/beam_validator.erl
+++ b/lib/compiler/src/beam_validator.erl
@@ -1362,13 +1362,13 @@ merge_states(L, St, Branched) when L =/= 0 ->
{value,OtherSt} -> merge_states_1(St, OtherSt)
end.
-merge_states_1(#st{x=Xs0,y=Ys0,numy=NumY0,h=H0,ct=Ct0}=St,
+merge_states_1(#st{x=Xs0,y=Ys0,numy=NumY0,h=H0,ct=Ct0},
#st{x=Xs1,y=Ys1,numy=NumY1,h=H1,ct=Ct1}) ->
NumY = merge_stk(NumY0, NumY1),
Xs = merge_regs(Xs0, Xs1),
Ys = merge_y_regs(Ys0, Ys1),
Ct = merge_ct(Ct0, Ct1),
- St#st{x=Xs,y=Ys,numy=NumY,h=min(H0, H1),ct=Ct}.
+ #st{x=Xs,y=Ys,numy=NumY,h=min(H0, H1),ct=Ct}.
merge_stk(S, S) -> S;
merge_stk(_, _) -> undecided.