-
Notifications
You must be signed in to change notification settings - Fork 2
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
Avoid exceptions when count
does not match the number of elements
#1
Conversation
@doomlaur Some remarks:
|
Note that another alternative is to just remove the throwing code. Tfussel already did this in PR tfussell#652. |
I can gladly work on these improvements - just let me know if you have any other thoughts on possible improvements, then I can start working 😉 |
No other remarks. |
I agree that a difference between debug and release builds would not be ideal - using unit tests and the CI tools would probably be the best compromise. Let me know if there's anything I can help with regarding AppVeyor and CircleCI. I don't have experience with either of these tools, but I did use TeamCity in the past. I'm going to work on the discussed improvements as soon as possible (either today or at least in the next couple of days) 😉 |
count
does not match the number of elements
… attribute. Added a unit tests with multiple wrong "count" values. Fixed a related exception when loading the shared string table with the wrong "uniqueCount".
Alright, so:
Let me know if you have any other comments, and thanks for reviewing! 😉 |
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.
Thanks for the changes!
…s only if THROW_ON_INVALID_XML is defined).
@doomlaur You will have to officially review and merge yourself as I was the creator of this PR. |
…tions like std::vector::reserve (or for other containers), creating simpler code. This now also ensures that memory is pre-allocated even if XML attributes like "count" specify an extreme number of elements (in which case no memory was previously allocated at all anymore).
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.
It's always awesome to approve my own PRs 😅
@m7913d I still need your approval, as I was the last one that pushed something 😉 Thanks! |
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.
Look goods, just some considerations about the copyright notice.
@doomlaur Github doesn't allow me to approve, as the PR creator can never approve. LOL We need more reviewers for this pull request. |
@m7913d Haha LOL 😆 For me, GitHub says:
I like the rule that a second maintainer has to approve, but can we somehow override this rule just for this PR, as it currently doesn't allow us to merge it? 😅 Otherwise the only other option I see is that we would have to close this PR and I would need to open a new one myself, then I would need your approval. |
@doomlaur I temporarily disabled the requirements that someone needed to review your latest commit, performed the merge and reenabled it. In the future, it is a good idea to not create a PR for code written by the other one. |
All PRs and Issues closed. Good job! |
Perfect, thanks! And I agree - I did not think about that case until now 😆
Thanks, and thank you for the great job as well! 😄 |
Fixes issue tfussell#735