Repository navigation
fixing problem with CPN model parsing overflow and query parsing overflow - #232
Merged
Merged
Conversation
srba
requested review from
a team and
mtygesen
and removed request for
a team
September 21, 2026 06:12
mtygesen
requested changes
Sep 29, 2026
| if (strcmp(element->name(), "numberconstant") == 0) { | ||
| auto value = element->first_attribute("value")->value(); | ||
| return (uint32_t)atoll(value); | ||
| uint64_t parsed = atoll(value); |
Contributor
There was a problem hiding this comment.
toBoundedTokens could be moved into errors,h and then reused here to avoid duplicated code
| } | ||
| errno = 0; | ||
| char* end = nullptr; | ||
| const long long parsed = std::strtoll(text, &end, 10); |
Contributor
There was a problem hiding this comment.
could pass std::string_view to the function and then use std::from_chars here, which is a bit cleaner
| errno = 0; | ||
| char* end = nullptr; | ||
| const long long parsed = std::strtoll(text, &end, 10); | ||
| if (end == text) { |
Contributor
There was a problem hiding this comment.
this currently allows e.g. "123abc"
| if (errno == ERANGE || | ||
| parsed < static_cast<long long>(std::numeric_limits<int32_t>::min()) || | ||
| parsed > static_cast<long long>(std::numeric_limits<int32_t>::max())) { | ||
| throw base_error("Integer constant ", text, " exceeded ", std::numeric_limits<int32_t>::max()); |
Contributor
There was a problem hiding this comment.
Show exceeded on both overflow and underflow. Maybe there could be two separate error messages to make it easier to diagnose
srba
commented
Oct 5, 2026
srba
left a comment
Member
Author
There was a problem hiding this comment.
Passes correctness tests on the cluster. In reachabilityCardinality about 30 fewer answers as there were queries with too large constants in GPPP-PT-0010G1... model.
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.
fixing the bug: https://bugs.launchpad.net/tapaal/+bug/2115670