Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
5883-beam_asm-Stricten-tests-for-integers.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 5883-beam_asm-Stricten-tests-for-integers.patch of Package erlang
From d5b14a339b5ed6ba15ea8771f061c7ab3c8720fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org> Date: Thu, 30 Jun 2022 05:17:07 +0200 Subject: [PATCH 3/6] beam_asm: Stricten tests for integers --- lib/compiler/src/beam_asm.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/compiler/src/beam_asm.erl b/lib/compiler/src/beam_asm.erl index 7317b2409d..54616e6a51 100644 --- a/lib/compiler/src/beam_asm.erl +++ b/lib/compiler/src/beam_asm.erl @@ -454,7 +454,7 @@ encode_arg({y, Y}, Dict) when is_integer(Y), Y >= 0 -> encode_arg({atom, Atom}, Dict0) when is_atom(Atom) -> {Index, Dict} = beam_dict:atom(Atom, Dict0), {encode(?tag_a, Index), Dict}; -encode_arg({integer, N}, Dict) -> +encode_arg({integer, N}, Dict) when is_integer(N) -> %% Conservatively assume that all integers whose absolute %% value is greater than 1 bsl 128 will be bignums in %% the runtime system. @@ -540,13 +540,13 @@ encode_alloc_list_1([], Dict, Acc) -> -spec encode(non_neg_integer(), integer()) -> iolist() | integer(). -encode(Tag, N) when N < 0 -> +encode(Tag, N) when is_integer(N), N < 0 -> encode1(Tag, negative_to_bytes(N)); -encode(Tag, N) when N < 16 -> +encode(Tag, N) when is_integer(N), N < 16 -> (N bsl 4) bor Tag; -encode(Tag, N) when N < 16#800 -> +encode(Tag, N) when is_integer(N), N < 16#800 -> [((N bsr 3) band 2#11100000) bor Tag bor 2#00001000, N band 16#ff]; -encode(Tag, N) -> +encode(Tag, N) when is_integer(N) -> encode1(Tag, to_bytes(N)). encode1(Tag, Bytes) -> -- 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