diff options
author | John Högberg <[email protected]> | 2019-07-11 10:43:19 +0200 |
---|---|---|
committer | John Högberg <[email protected]> | 2019-07-11 10:44:21 +0200 |
commit | 5c116e4fbf19632c195b8b5cb32d248c8744eff1 (patch) | |
tree | 222ecec9db68c6ff359a716a5349c6841c42de80 /lib | |
parent | bb3ab56962bae22e40b51dfce18ef37b465087a7 (diff) | |
download | otp-5c116e4fbf19632c195b8b5cb32d248c8744eff1.tar.gz otp-5c116e4fbf19632c195b8b5cb32d248c8744eff1.tar.bz2 otp-5c116e4fbf19632c195b8b5cb32d248c8744eff1.zip |
beam_validator: Remove redundant calls to infer_types
Diffstat (limited to 'lib')
-rw-r--r-- | lib/compiler/src/beam_validator.erl | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/compiler/src/beam_validator.erl b/lib/compiler/src/beam_validator.erl index afede2b54d..a2e4707758 100644 --- a/lib/compiler/src/beam_validator.erl +++ b/lib/compiler/src/beam_validator.erl @@ -1595,27 +1595,23 @@ infer_types(CompareOp, LHS, RHS, #vst{current=#st{vs=Vs}}=Vst0) -> Vst0 end. -infer_types_1(#value{op={bif,'=:='},args=[LHS,RHS]}, Val, Op, Vst0) -> +infer_types_1(#value{op={bif,'=:='},args=[LHS,RHS]}, Val, Op, Vst) -> case Val of {atom, Bool} when Op =:= eq_exact, Bool; Op =:= ne_exact, not Bool -> - Vst = infer_types(eq_exact, RHS, LHS, Vst0), infer_types(eq_exact, LHS, RHS, Vst); {atom, Bool} when Op =:= ne_exact, Bool; Op =:= eq_exact, not Bool -> - Vst = infer_types(ne_exact, RHS, LHS, Vst0), infer_types(ne_exact, LHS, RHS, Vst); _ -> - Vst0 + Vst end; -infer_types_1(#value{op={bif,'=/='},args=[LHS,RHS]}, Val, Op, Vst0) -> +infer_types_1(#value{op={bif,'=/='},args=[LHS,RHS]}, Val, Op, Vst) -> case Val of {atom, Bool} when Op =:= ne_exact, Bool; Op =:= eq_exact, not Bool -> - Vst = infer_types(ne_exact, RHS, LHS, Vst0), infer_types(ne_exact, LHS, RHS, Vst); {atom, Bool} when Op =:= eq_exact, Bool; Op =:= ne_exact, not Bool -> - Vst = infer_types(eq_exact, RHS, LHS, Vst0), infer_types(eq_exact, LHS, RHS, Vst); _ -> - Vst0 + Vst end; infer_types_1(#value{op={bif,element},args=[{integer,Index},Tuple]}, Val, Op, Vst) when Index >= 1 -> |