aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_type.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2019-01-12 06:43:15 +0100
committerBjörn Gustavsson <[email protected]>2019-01-14 15:23:08 +0100
commitc9f5fdb5c92c418f28d67bb62ea8baac296da5ac (patch)
tree44abda5443bd3a25e980dbe85096bd805b052042 /lib/compiler/src/beam_type.erl
parentc27e37d5c37b1edb81f9521b96bdd996ca25653b (diff)
downloadotp-c9f5fdb5c92c418f28d67bb62ea8baac296da5ac.tar.gz
otp-c9f5fdb5c92c418f28d67bb62ea8baac296da5ac.tar.bz2
otp-c9f5fdb5c92c418f28d67bb62ea8baac296da5ac.zip
beam_type: Eliminate compiler crash when arithmetic expression fails
The compiler would crash when compiling code such as: (A / B) band 16#ff The type for the expression would be 'none', but beam_type:verified_type/1 did not handle 'none'. https://bugs.erlang.org/browse/ERL-829
Diffstat (limited to 'lib/compiler/src/beam_type.erl')
-rw-r--r--lib/compiler/src/beam_type.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/compiler/src/beam_type.erl b/lib/compiler/src/beam_type.erl
index b5c979e529..a1e9eff8f3 100644
--- a/lib/compiler/src/beam_type.erl
+++ b/lib/compiler/src/beam_type.erl
@@ -1114,4 +1114,5 @@ verified_type(nonempty_list=T) -> T;
verified_type({tuple,_,Sz,[]}=T) when is_integer(Sz) -> T;
verified_type({tuple,_,Sz,[_]}=T) when is_integer(Sz) -> T;
verified_type({tuple_element,_,_}=T) -> T;
-verified_type(float=T) -> T.
+verified_type(float=T) -> T;
+verified_type(none=T) -> T.