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.
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
Fix HalModuleParser.parsePrefix() when parsing valid compressed binaries #41
Fix HalModuleParser.parsePrefix() when parsing valid compressed binaries #41
Changes from all commits
a1e4580
1347367
37764d1
e680fef
07809f1
807c47c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A comment why we don't want to fail immediately if the file is larger than what is specified in the module header would be helpful here (padded/combined modules).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/particle-iot/binary-version-reader/pull/41/files#diff-1191fb254480711d2964abf2c8ce9727c95f0e24d7a032142ff18c792b49b14bR306
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-zero version numbers (of the module itself and its dependencies) can be another 0.25 score points 🙂 Also, the fact that start/end addresses are in the internal flash (where applicable) that was checked in the old code was a good indication that we're dealing with a valid module, IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be able to get away without these kinds of platform-specific checks and probably should if we can. It's also impossible to implement such checks properly for Gen 3 platforms as addresses in the internal flash are generic 0 to 1MB.
As discussed in Slack, let's keep things as-is. Given all the other checks it's anyway highly likely that the versions will not be zero.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes. Thank you so much for doing this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah this reads far better I really like this cleanup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first I was going to suggest adding a zero offset to the list of preferred ones, but then I noticed that it's actually there, it just didn't deserve its own line in the array definition. I'd add a comment that the module header typically starts at 0 offset if it's a user part or other non-system/bootloader module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved 0 to a separate line and added an additional comment.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.