Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PartialTagParser exhaustion side effect?! #137

Open
ProIcons opened this issue Oct 2, 2022 · 0 comments
Open

PartialTagParser exhaustion side effect?! #137

ProIcons opened this issue Oct 2, 2022 · 0 comments

Comments

@ProIcons
Copy link

ProIcons commented Oct 2, 2022

if (slice.IsEmpty)
{
return false;
}

This should throw an exception instead of returning false. At this point there's nothing in the Slice, and the parser is moving to the next InlineParser -> InterpolationTagParser
which fails on

With IndexOutOfBounds Exception. While this indeed throws an exception, it doesn't throw it on the correct place.

If the intention is to support Parsers before the InterpolationTagParser with the ParserPipeline, then in that, if condition, the slice's start position should be reverted to its original, before returning false.

ProIcons added a commit to ProIcons/Stubble that referenced this issue Oct 2, 2022
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

No branches or pull requests

1 participant