Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added support for map comprehensions
- Added USB CDC port drivers for ESP32, RP2, and STM32 platforms
- Added a Linux `gpio` driver for the generic_unix port (in `avm_unix`) using sysfs
- Added support for non-byte-aligned bitstrings, including with the legacy construction
opcodes emitted by OTP 26-27 with `no_bs_create_bin`, and added `erlang:bitstring_to_list/1`

### Changed
- Updated network type db() to dbm() to reflect the actual representation of the type
Expand Down Expand Up @@ -64,12 +66,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed `ahttp_client` crash on non-numeric or negative `Content-Length` values
- Fixed `ahttp_client` crash on headers with empty or all-whitespace values
- Fixed a bug in `supervisor` handling of failing child
- Fixed a one-byte out-of-bounds read and write in bit-granular bitstring copies, which could
touch the byte past an exactly-sized destination or source buffer
- Fixed matching an `all`-sized segment with a non-power-of-two unit, which the JIT tested with an
`and` mask and rejected as unsupported
- Fixed a `binary` segment accepting a non-byte-aligned bitstring source instead of raising `badarg`
- Fixed two bugs related to closing fds in `atomvm:subprocess/4`
- Fixed `erlang:localtime/1` memory leak, use-after-free, and TZ restore bugs on newlib/picolibc
- Fixed ESP32 I2C driver resource leaks, half-closed state, and close-during-transmission errors
- Fixed several underallocation issues that could trigger data corruption on `binary:replace`, `zlib:compress` and bsd socket recv code.
- Fixed a bug where `catch` would raise on regular atom results
- Fixed ESP32 socket driver holding the global socket-list lock across blocking TCP connects, leaking the port on connect failure, losing concurrent `accept` waiters, leaking `netbuf` on receive error paths, and a recycled-`netconn` race between socket close and the event handler
- Fixed a negative dynamic segment size being scaled by the segment unit before validation, which
could let a match succeed with a wrapped-around size, and could move the match offset before the
start of the binary and crash under JIT
- Fixed the JIT untagging small integers with a logical instead of an arithmetic shift, turning a
negative integer into a large positive one

## [0.7.0-alpha.1] - 2026-04-06

Expand Down
1 change: 0 additions & 1 deletion doc/src/apidocs/libatomvm/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ Functions
.. doxygenfunction:: term_binary_heap_size
.. doxygenfunction:: term_binary_size_is_heap_binary
.. doxygenfunction:: term_boxed_size
.. doxygenfunction:: term_bs_insert_binary
.. doxygenfunction:: term_compare
.. doxygenfunction:: term_create_empty_binary
.. doxygenfunction:: term_create_uninitialized_binary
Expand Down
30 changes: 30 additions & 0 deletions libs/estdlib/src/erlang.erl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
binary_to_integer/1,
binary_to_integer/2,
binary_to_list/1,
bitstring_to_list/1,
atom_to_binary/1,
atom_to_binary/2,
atom_to_list/1,
Expand Down Expand Up @@ -151,6 +152,7 @@
hd/1,
is_atom/1,
is_binary/1,
is_bitstring/1,
is_boolean/1,
is_float/1,
is_function/1,
Expand Down Expand Up @@ -892,6 +894,21 @@ binary_to_integer(_Binary, _Base) ->
binary_to_list(_Binary) ->
erlang:nif_error(undefined).

%%-----------------------------------------------------------------------------
%% @param Bitstring Bitstring to convert to list
%% @returns a list of bytes, with a final element holding the trailing bits if
%% `Bitstring' is not a whole number of bytes
%% @doc Convert a bitstring to a list of bytes.
%%
%% If the number of bits in `Bitstring' is not divisible by `8', the
%% last element of the list is a bitstring containing the trailing
%% `1..7' bits, e.g. `bitstring_to_list(<<1:1>>)' returns `[<<1:1>>]'.
%% @end
%%-----------------------------------------------------------------------------
-spec bitstring_to_list(Bitstring :: bitstring()) -> [byte() | bitstring()].
bitstring_to_list(_Bitstring) ->
erlang:nif_error(undefined).

%%-----------------------------------------------------------------------------
%% @param Atom Atom to convert
%% @returns a binary with the atom's name
Expand Down Expand Up @@ -1863,6 +1880,19 @@ is_atom(_Term) ->
is_binary(_Term) ->
erlang:nif_error(undefined).

%%-----------------------------------------------------------------------------
%% @param Term the term to test
%% @returns `true' if `Term' is a bitstring; `false', otherwise.
%% @doc Return `true' if `Term' is a bitstring (including a binary);
%% `false', otherwise.
%%
%% This function may be used in a guard expression.
%% @end
%%-----------------------------------------------------------------------------
-spec is_bitstring(Term :: term()) -> boolean().
is_bitstring(_Term) ->
erlang:nif_error(undefined).

%%-----------------------------------------------------------------------------
%% @param Term the term to test
%% @returns `true' if `Term' is a boolean (`true' or `false'); `false', otherwise.
Expand Down
Loading
Loading