Repository navigation
schema compile BUGFIX unique leaf in a disabled subtree - #2672
Open
lamestllama wants to merge 1 commit into
Open
lamestllama wants to merge 1 commit into
lamestllama wants to merge 1 commit into
Conversation
A disabled node was removed from the uniques of its list ancestors only when it was itself a unique leaf. When an ancestor of a unique leaf was disabled by if-feature, the leaf was freed with it and the list kept a pointer to it, which was then read after it was freed. Every unique leaf in the disabled subtree is now removed, and a unique left without leaves is removed with it.
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.
Hi, hope this is enough of a description.
What
lys_compile_unres_check_disabled()now removes from the uniques of every list ancestor each leaf that is the disabled node or inside its subtree, and a unique left without leaves, instead of only a leaf that is itself disabled.Why
A leaf whose ancestor below the list is disabled by
if-featureis freed with that ancestor, so the list kept a pointer to freed memory, read bylysc_path()and by data validation.Fixes #2671
Test
A list with
unique "c/x"andunique "c/y k"under a disabled containercintest_node_list(test_tree_schema_compile.c) keeps one unique,k; it fails before the fix, and all ofctestpasses after it.