Skip to content

Conversation

petermm
Copy link
Contributor

@petermm petermm commented Aug 10, 2025

We need the try/rescue due to potential false positives on 0x78, and we need the case matching for happy path.

Afaik packbeam is being unified, so this is interim quickfix.

Tested main, with hello world (otp27 and otp28) - more issues with OTP28 may exist.

Fixes #57

We need the try/rescue due to potential false positives on 0x78, and we need the case matching for happy path.

Afaik packbeam is being unified, so this is interim quickfix.

Signed-off-by: Peter M <[email protected]>
@petermm petermm force-pushed the fix-uncompressed-otp28-literals branch from 9b16e21 to 550d22f Compare September 21, 2025 10:36
Copy link
Contributor

@UncleGrumpy UncleGrumpy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you have should work fine, but it may be simpler to handle this closer to what atomvm_packbeam does to match on the uncompressed OTP 28 literals.

try do
:zlib.uncompress(data)
rescue
_error -> data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than try ... rescue you can match wnen <<0:32, data::binary>> sooner (before line 19 above) and only pass the data to :zlib.uncompress/1 if it later matches <<_header::binary-size(4), data::binary>>.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, makes sense.

try do
:zlib.uncompress(data)
rescue
_error -> data
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, makes sense.

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.

Unable to run atomvm.packbeam
3 participants