aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_utils.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-11-26 08:22:52 +0100
committerBjörn Gustavsson <[email protected]>2017-11-27 10:20:19 +0100
commitc8ab08ec94c2b744342f8ee01c7f95a264f888df (patch)
tree6a71f73d437cb143ff8a3d22fac807b0a82b581b /lib/compiler/src/beam_utils.erl
parent5f27079c58ac9705b5e1c81cd5a14c1d245afd66 (diff)
downloadotp-c8ab08ec94c2b744342f8ee01c7f95a264f888df.tar.gz
otp-c8ab08ec94c2b744342f8ee01c7f95a264f888df.tar.bz2
otp-c8ab08ec94c2b744342f8ee01c7f95a264f888df.zip
Recognize 'nil' as a literal in beam_utils:bif_to_test/3
beam_utils:bif_to_test/3 is supposed to never put a literal operand as the first operand in is_eq_exact or is_ne_exact, but 'nil' was not recognized as a literal.
Diffstat (limited to 'lib/compiler/src/beam_utils.erl')
-rw-r--r--lib/compiler/src/beam_utils.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/compiler/src/beam_utils.erl b/lib/compiler/src/beam_utils.erl
index 00f396c246..dd7ec4da96 100644
--- a/lib/compiler/src/beam_utils.erl
+++ b/lib/compiler/src/beam_utils.erl
@@ -32,7 +32,8 @@
-import(lists, [map/2,member/2,sort/1,reverse/1,splitwith/2]).
--define(is_const(Val), (element(1, Val) =:= integer orelse
+-define(is_const(Val), (Val =:= nil orelse
+ element(1, Val) =:= integer orelse
element(1, Val) =:= float orelse
element(1, Val) =:= atom orelse
element(1, Val) =:= literal)).