diff options
author | Sverker Eriksson <[email protected]> | 2017-11-03 16:11:00 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2017-11-03 16:11:00 +0100 |
commit | 5369e34a892bfd8ab5aa98df330e3bbf19497b71 (patch) | |
tree | 3318db2776a9d32f77bdafdee0c5268e760c6607 /lib/hipe/rtl/hipe_rtl_binary_construct.erl | |
parent | 31e6c79f956f71e80d8f6be48e5ab8df87f2b85c (diff) | |
download | otp-5369e34a892bfd8ab5aa98df330e3bbf19497b71.tar.gz otp-5369e34a892bfd8ab5aa98df330e3bbf19497b71.tar.bz2 otp-5369e34a892bfd8ab5aa98df330e3bbf19497b71.zip |
Fix bug in hipe for <<X/utf32>>
by introducing new primop 'is_unicode'
with no exception (ab)use and no GC.
Replaces bs_validate_unicode which is kept for backward compat for now.
Diffstat (limited to 'lib/hipe/rtl/hipe_rtl_binary_construct.erl')
-rw-r--r-- | lib/hipe/rtl/hipe_rtl_binary_construct.erl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/hipe/rtl/hipe_rtl_binary_construct.erl b/lib/hipe/rtl/hipe_rtl_binary_construct.erl index 52ea5db382..bc215e3abe 100644 --- a/lib/hipe/rtl/hipe_rtl_binary_construct.erl +++ b/lib/hipe/rtl/hipe_rtl_binary_construct.erl @@ -195,8 +195,13 @@ gen_rtl(BsOP, Dst, Args, TrueLblName, FalseLblName, SystemLimitLblName, ConstTab bs_validate_unicode -> [_Arg] = Args, - [hipe_rtl:mk_call([], bs_validate_unicode, Args, - TrueLblName, FalseLblName, not_remote)]; + [IsUnicode] = create_regs(1), + RetLbl = hipe_rtl:mk_new_label(), + [hipe_rtl:mk_call([IsUnicode], is_unicode, Args, + hipe_rtl:label_name(RetLbl), [], not_remote), + RetLbl, + hipe_rtl:mk_branch(IsUnicode, ne, hipe_rtl:mk_imm(0), + TrueLblName, FalseLblName, 0.99)]; bs_final -> Zero = hipe_rtl:mk_imm(0), |