Skip to content

Conversation

@pguyot
Copy link
Collaborator

@pguyot pguyot commented Apr 4, 2025

  1. OP_BS_MATCH_STRING would ignore length of matched binary strings during comparisons, thus possibly making comparison of unallocated data. Probably harmless on microcontrollers, but Valgrind has the right to complain.
  2. OP_BS_MATCH_STRING would also be disabled if MINIMUM_OTP_COMPILER_VERSION was greater than 25, but it can be generated (rarely) by OTP-27.
  3. term_set_match_state_offset was called including in cases where there was no match. This may have been harmless as Erlang compiler may always dispose match state when match fails.

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

1. OP_BS_MATCH_STRING would ignore matched binary string during comparisons,
thus possibly making comparison of unallocated data. Probably harmless on
microcontrollers, but Valgrind has the right to complain.
2. OP_BS_MATCH_STRING would also be disabled if MINIMUM_OTP_COMPILER_VERSION
was greater than 25, but it can be generated (rarely) by OTP-27.
3. term_set_match_state_offset was called including in cases where there
was no match. This may have been harmless as Erlang compiler may always
dispose match state when match fails.

Signed-off-by: Paul Guyot <pguyot@kallisys.net>
@bettio bettio merged commit 87441e6 into atomvm:release-0.6 Apr 6, 2025
137 of 140 checks passed
bettio added a commit that referenced this pull request Apr 6, 2025
Merge is_record BIF (PR #1564) and fixes (such as PR #1615 and #1617) from
release-0.6 branch.
@pguyot pguyot deleted the w14/fix-op_bs_match_string branch April 6, 2025 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants