-
Notifications
You must be signed in to change notification settings - Fork 381
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: incorrect pointer value comparison #1601
fix: incorrect pointer value comparison #1601
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1601 +/- ##
==========================================
- Coverage 55.80% 45.84% -9.96%
==========================================
Files 436 460 +24
Lines 66168 69636 +3468
==========================================
- Hits 36922 31924 -4998
- Misses 26356 35052 +8696
+ Partials 2890 2660 -230 ☔ View full report in Codecov by Sentry. |
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 pretty good. I think we need to guard against invalid type comparisons.
@ltzmaxwell |
Updated 🙏 . |
I don't think that fixed it -- see this comment #1601 (comment) |
This is a fix to #1569 . Thanks to @thehowl for identifying this issue and providing a thorough and insightful analysis.
Here is an further analysis based on #1569 :
this comparison would be false too.
The root cause for this is the way pointer values is obtained and compared, e.g.
in this code snippet, the address of the c[0], (&c[0]) is obtained from this:
that is a reference to the element of the underlying list of arrayValue,
in case like this:
the address is obtained by
that is a new allocated *TV, which implies the value of it would not be same within the first and second & operation.
So we should actually compare the concrete value rather than the pointers for this case.