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

Nom based parser #4

Closed
wants to merge 4 commits into from
Closed

Nom based parser #4

wants to merge 4 commits into from

Conversation

khernyo
Copy link
Member

@khernyo khernyo commented May 15, 2018

This is a 🐛 bug fix.

Fixes #3 by rewriting the parser using the nom library. The new version should handle all errors, but more tests are necessary to make sure. Another benefit is that it's about twice as fast as before.

There is one problem though, error messages are hard to understand. It can be fixed, but it needs some work.

Checklist

  • tests pass
  • tests and/or benchmarks are included

Semver Changes

Minor level because of the deprecated function Header::from_vec.

@yoshuawuyts
Copy link
Contributor

Heya, thanks for this patch!

To be fair I'm not entirely sure what to do here. I love the fact that the code is faster & fixes the input bug - but I find it really hard to read, and I'm not sure if I could update the code when needed.

Probably the most important bit right now would be to find a fix for the bug that the fuzzer showed. I'm less worried about performance bottlenecks, as this is unlikely to be a bottleneck. Do you reckon there might be a way to fix the byteorder based parser instead?

Hope it makes sense where I'm coming from. Thanks so much again!

@khernyo
Copy link
Member Author

khernyo commented Jun 5, 2018

It makes sense. I'm curious, though, which part of it do you find hard to read? Is it primarily convert_nom_result() in header.rs or the parser itself in parsers.rs?

I'll see how hard it is to fix the bug without rewriting.

@khernyo khernyo mentioned this pull request Jun 5, 2018
2 tasks
@khernyo
Copy link
Member Author

khernyo commented Jun 5, 2018

Overridden by #6

@khernyo khernyo closed this Jun 5, 2018
@khernyo khernyo deleted the nom-based-parser branch June 5, 2018 18:27
@khernyo khernyo restored the nom-based-parser branch June 5, 2018 18:28
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

Successfully merging this pull request may close these issues.

Crashes found by honggfuzz
2 participants