Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: add missing is_number check to fconv opcode #1367

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

bettio
Copy link
Collaborator

@bettio bettio commented Nov 17, 2024

fconv takes also registers as argument, hence they might contain a value that is not a valid number term.

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

@pguyot
Copy link
Collaborator

pguyot commented Nov 17, 2024

What is the Erlang code that can trigger a crash (or a badarith with this PR ?)

@bettio
Copy link
Collaborator Author

bettio commented Nov 17, 2024

What is the Erlang code that can trigger a crash (or a badarith with this PR ?)

I was able to make a test case, I confirm that badarith is the right error. I added the test case as part of our test suite.

term_conv_to_float expects a valid number term.

Signed-off-by: Davide Bettio <[email protected]>
@bettio bettio merged commit 7e06d45 into atomvm:release-0.6 Nov 20, 2024
95 checks passed
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