diff options
author | Björn Gustavsson <[email protected]> | 2018-11-21 10:21:51 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2018-11-21 10:21:51 +0100 |
commit | f8183c3949b3da11fafac4e5b7737fb75e0d0f11 (patch) | |
tree | 620da7a332562f8acb79771c8ce73ce5c61c5072 /lib/compiler/src/beam_utils.erl | |
parent | c0812d51fbb550d4a53df128e4ec322746f015ca (diff) | |
parent | 8be2c32fe0534d863c6ce6d7665011a162fc39ec (diff) | |
download | otp-f8183c3949b3da11fafac4e5b7737fb75e0d0f11.tar.gz otp-f8183c3949b3da11fafac4e5b7737fb75e0d0f11.tar.bz2 otp-f8183c3949b3da11fafac4e5b7737fb75e0d0f11.zip |
Merge branch 'bjorn/compiler/is_function/ERL-778/OTP-15435' into maint
* bjorn/compiler/is_function/ERL-778/OTP-15435:
Fix internal consistency failure for is_function/2
Diffstat (limited to 'lib/compiler/src/beam_utils.erl')
-rw-r--r-- | lib/compiler/src/beam_utils.erl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/compiler/src/beam_utils.erl b/lib/compiler/src/beam_utils.erl index 6e23003fc7..6b2ab5a2a4 100644 --- a/lib/compiler/src/beam_utils.erl +++ b/lib/compiler/src/beam_utils.erl @@ -745,8 +745,11 @@ check_liveness_block_2(R, {gc_bif,Op,{f,Lbl}}, Ss, St) -> check_liveness_block_3(R, Lbl, {Op,length(Ss)}, St); check_liveness_block_2(R, {bif,Op,{f,Lbl}}, Ss, St) -> Arity = length(Ss), + + %% Note that is_function/2 is a type test but is not safe. case erl_internal:comp_op(Op, Arity) orelse - erl_internal:new_type_test(Op, Arity) of + (erl_internal:new_type_test(Op, Arity) andalso + erl_bifs:is_safe(erlang, Op, Arity)) of true -> {killed,St}; false -> |