-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 underflow panic in InitTriInfo
#14893
Conversation
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
Note that this will add a merge conflict to #9050 |
@ethereumdegen your review here would be appreciated. |
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'm honestly not convinced that the code in question should run smoothly. That mesh seems whacky and bound to cause problems down the line. @ethereumdegen's offending mesh was similarly malformed. Do we at least print a warn!
in this case?
It doesnt have to run smoothly it can throw an error from the result But it shouldnt crash the entire program |
|
Yeah my pr is about generate_tangents not mesh new
…On Fri, Aug 23, 2024 at 12:57 PM Jan Hohenheim ***@***.***> wrote:
Mesh::new doesn't return a result. Am I missing something?
—
Reply to this email directly, view it on GitHub
<#14893 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABPVWL5TC4ZJQW3TZYDS7OTZS5SXXAVCNFSM6AAAAABNAJSJFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBXGQ3DQMRSHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@ethereumdegen Ooooooh I see, I didn't scroll down enough on the example code, haha. That makes sense then :) |
Maybe it would be more appropriate to change the place where a panic occurs from |
InitTriInfo
to prevent underflow panicInitTriInfo
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.
@kumikaya I would prefer it if there was no panic at all, and instead generate_tangents
returned an error in this case.
Also, no need to force push your commits to clean the history; the PR get squashed anyways and by leaving the history intact you make it easier for future readers :)
@janhohenheim Yeah, it would be better to check if |
@kumikaya feel free to ping me when the code you posted in the PR description results in |
@janhohenheim I've updated the code in the PR, |
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.
Looks good to me then :)
Thanks for fixing the crash!
Objective
Solution
t < iNrTrianglesIn - 1
tot + 1 < iNrTrianglesIn
.Testing
Migration Guide