Modelling - ShapeUpgrade_UnifySameDomain crash#876
Merged
dpasukhi merged 2 commits intoOpen-Cascade-SAS:IRfrom Dec 4, 2025
Merged
Modelling - ShapeUpgrade_UnifySameDomain crash#876dpasukhi merged 2 commits intoOpen-Cascade-SAS:IRfrom
dpasukhi merged 2 commits intoOpen-Cascade-SAS:IRfrom
Conversation
Improved handling of degenerated curves in ShapeUpgrade_UnifySameDomain
dpasukhi
approved these changes
Dec 4, 2025
There was a problem hiding this comment.
Pull request overview
This PR addresses a crash in ShapeUpgrade_UnifySameDomain by adding null checks for degenerated curves before attempting to evaluate them. The fix prevents dereferencing null curve handles that can occur when processing edges with degenerated 2D curve representations.
Key changes:
- Added null safety checks for
BRepAdaptor_Curve2d::Curve()before evaluating curve parameters - Modernized variable declarations with
constqualifiers - Replaced conditional assignment with
std::minfor cleaner code
Comment on lines
+340
to
+341
| const gp_Pnt2d FirstP2d = BAcurve2d.Value(BAcurve2d.FirstParameter()); | ||
| const gp_Pnt2d LastP2d = BAcurve2d.Value(BAcurve2d.LastParameter()); |
There was a problem hiding this comment.
Variable declarations should follow OCCT naming conventions. According to the OCCT guidelines, local variables should use the pattern aVariableName, not FirstP2d and LastP2d. These should be renamed to aFirstP2d and aLastP2d respectively.
dpasukhi
pushed a commit
to dpasukhi/OCCT
that referenced
this pull request
Dec 5, 2025
- Added null safety checks for `BRepAdaptor_Curve2d::Curve()` before evaluating curve parameters - Modernized variable declarations with `const` qualifiers - Replaced conditional assignment with `std::min` for cleaner code
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.
Improved handling of degenerated curves in ShapeUpgrade_UnifySameDomain