Fix BEAM process crash on nested empty map property enumeration#8
Merged
dannote merged 1 commit intoApr 23, 2026
Merged
Conversation
beam_proxy.get_own_property_names calls js_malloc(ctx, 0) when the
BEAM map is empty and has no overrides, hitting QuickJS's
assert(size != 0). Return early with empty results when total == 0.
Accessing a nested empty map via Object.keys or for...in
(e.g. QuickBEAM.call(rt, "fn", [%{x: %{}}])) crashed the entire
BEAM process. Top-level empty maps were unaffected.
dannote
added a commit
that referenced
this pull request
Apr 23, 2026
Fix BEAM crash on nested empty map property enumeration
Member
|
Thanks for the fix! Merged with one additional change on top: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7
beam_proxy.get_own_property_namescallsjs_malloc(ctx, 0)when the BEAM map is empty and has no overrides, hitting QuickJS'sassert(size != 0). Return early with empty results whentotal == 0.Change
lib/quickbeam/beam_proxy.zig— 4 lines added:Test
test/core/beam_proxy_empty_map_test.exs— 3 cases:Object.keys,for...inon nested empty map, plus non-empty control.