Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
1265-erl_bits.-ch-Correct-type-for-sizes.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1265-erl_bits.-ch-Correct-type-for-sizes.patch of Package erlang
From 0594990c5c38b427de27b2d0536a6d73a8c38be8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org> Date: Tue, 23 May 2023 14:29:16 +0200 Subject: [PATCH] erl_bits.[ch]: Correct type for sizes Code such as the following would crash the runtime system because the size would not fit in an `int`: start() -> <<0:1, (1 bsl 64):(1 bsl 32)/unit:8>>. --- erts/emulator/beam/erl_bits.c | 2 +- erts/emulator/beam/erl_bits.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/erts/emulator/beam/erl_bits.c b/erts/emulator/beam/erl_bits.c index 9fa010bed0..4e43c141d2 100644 --- a/erts/emulator/beam/erl_bits.c +++ b/erts/emulator/beam/erl_bits.c @@ -781,7 +781,7 @@ fmt_int(byte *buf, Uint sz, Eterm val, Uint size, Uint flags) } static void -ERTS_INLINE need_byte_buf(ERL_BITS_PROTO_1(int need)) +ERTS_INLINE need_byte_buf(ERL_BITS_PROTO_1(Uint need)) { if (byte_buf_len < need) { erts_atomic_add_nob(&bits_bufs_size, need - byte_buf_len); diff --git a/erts/emulator/beam/erl_bits.h b/erts/emulator/beam/erl_bits.h index 25aff39047..6165b09b85 100644 --- a/erts/emulator/beam/erl_bits.h +++ b/erts/emulator/beam/erl_bits.h @@ -54,7 +54,7 @@ struct erl_bits_state { * Used for building binaries. */ byte *byte_buf_; - int byte_buf_len_; + Uint byte_buf_len_; /* * Used for building binaries using the new instruction set. */ -- 2.35.3
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