This repository was archived by the owner on Sep 9, 2025. It is now read-only.
Don't add divergent partial paths to database#89
Merged
Conversation
A divergent partial path is one that starts at the root node and has an empty symbol stack precondition. That empty precondition means that it can be concatenated to _any_ path that currently ends at the root node — including the result of that concatenation! That gives us a divergence, since we can continually prepend the path's postcondition to the current symbol stack, forever. This patch adds a check that ensures that we never add this kind of partial path to a `Database` instance. (Without this check, we would end up allocating an unusably large amount of memory, since we're currently representing empty lists with a `u32::max` arena handle!)
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
A divergent partial path is one that starts at the root node and has an empty symbol stack precondition. That empty precondition means that it can be concatenated to any path that currently ends at the root node — including the result of that concatenation! That gives us a divergence, since we can continually prepend the path's postcondition to the current symbol stack, forever.
This patch adds a check that ensures that we never add this kind of partial path to a
Databaseinstance. (Without this check, we would end up allocating an unusably large amount of memory, since we're currently representing empty lists with au32::maxarena handle!)