Repository navigation
Conversation
TDwarfExpressionPattern::Matches() kept comparing pattern operations after the expression ran out. A DWARFExpression end iterator still holds the last decoded operation, so a pattern that repeats the last operation matched a shorter expression: [breg7 8, deref, deref] matched [breg7 8, deref]. None of the current CFA patterns repeat their last operation, so this does not change the unwind tables built today, but it makes adding patterns that share a prefix safe. Add unit tests for the matcher.
✅ All contributors are covered under a CLA with YandexSee CONTRIBUTING.md for more info about Yandex Contributor License Agreement. The following contributors were found: (Only the first commit for a unique contributor is listed) |
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.
Problem
TDwarfExpressionPattern::Matches()keeps comparing pattern operations after the expression has run out.A
DWARFExpressionend iterator still holds the last decoded operation (only itsErrorflag is set),so a pattern that repeats the last operation matches a shorter expression:
[breg7 8, deref, deref]matches[breg7 8, deref].None of the current CFA patterns repeat their last operation, so the unwind tables built today are not
affected. It matters for patterns that share a prefix, such as
*(reg + offset)and*(reg + offset) + biasadded in #130.Fix
Return
falsewhen the expression ends before the pattern does.Testing
New
agent/preprocessing/lib/utwith matcher tests: exact match with wildcards, operand mismatch,expressions longer and shorter than the pattern, an empty expression, and a pattern repeating the last
operation. Without the fix,
PatternRepeatingLastOperationfails: