Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
2711-erl_bits-Remove-unnecessary-type-test.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2711-erl_bits-Remove-unnecessary-type-test.patch of Package erlang
From a9cbf22724c648d10c0eae3eb2221671cd8f1360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org> Date: Wed, 6 Oct 2021 15:15:39 +0200 Subject: [PATCH 1/6] erl_bits: Remove unnecessary type test OTP 25 will refuse to load ancient BEAM files (OTP R11B or earlier) that would need this type test. --- erts/emulator/beam/erl_bits.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/erts/emulator/beam/erl_bits.c b/erts/emulator/beam/erl_bits.c index 33c66e49b0..e4dcb729f8 100644 --- a/erts/emulator/beam/erl_bits.c +++ b/erts/emulator/beam/erl_bits.c @@ -1043,16 +1043,10 @@ erts_new_bs_put_binary_all(Process *c_p, Eterm arg, Uint unit) ERL_BITS_DEFINE_STATEP(c_p); /* - * This type test is not needed if the code was compiled with - * an R12B or later compiler, since there would have been a - * call to bit_size/1 or byte_size/1 that would have failed if - * 'arg' was not a binary. However, in R11B and earlier releases, - * size/1 was use for calculating the size of the binary, and - * therefore 'arg' could be a tuple. + * This instruction is always preceded by a size calculation that + * will guarantee that 'arg' is a binary. */ - if (!is_binary(arg)) { - return 0; - } + ASSERT(is_binary(arg)); ERTS_GET_BINARY_BYTES(arg, bptr, bitoffs, bitsize); num_bits = 8*binary_size(arg)+bitsize; -- 2.31.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor