diff options
author | Björn Gustavsson <[email protected]> | 2019-01-12 06:43:15 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2019-01-14 15:23:08 +0100 |
commit | c9f5fdb5c92c418f28d67bb62ea8baac296da5ac (patch) | |
tree | 44abda5443bd3a25e980dbe85096bd805b052042 /lib/compiler/test | |
parent | c27e37d5c37b1edb81f9521b96bdd996ca25653b (diff) | |
download | otp-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/test')
-rw-r--r-- | lib/compiler/test/beam_type_SUITE.erl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/compiler/test/beam_type_SUITE.erl b/lib/compiler/test/beam_type_SUITE.erl index 061076b3ff..9f691716e3 100644 --- a/lib/compiler/test/beam_type_SUITE.erl +++ b/lib/compiler/test/beam_type_SUITE.erl @@ -157,6 +157,10 @@ coverage(Config) -> [_|_] -> ok end, + + %% Cover beam_type:verified_type(none). + {'EXIT',{badarith,_}} = (catch (id(2) / id(1)) band 16#ff), + ok. booleans(_Config) -> |