-
Notifications
You must be signed in to change notification settings - Fork 991
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 issues mixing 'const'-ness of STRING_PTR_RO #6659
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6659 +/- ##
=======================================
Coverage 98.61% 98.61%
=======================================
Files 79 79
Lines 14559 14559
=======================================
Hits 14358 14358
Misses 201 201 ☔ View full report in Codecov by Sentry. |
Generated via commit 24cbd00 Download link for the artifact containing the test results: ↓ atime-results.zip
|
Counter-intuitively, a We're not allowed to |
Thanks for the explanation (which I'm still processing)! I had noticed that the compiler doesn't care if we used IMO understanding why |
That's reasonable. Besides, the memory is writeable anyway, so the cast will not introduce undefined behaviour. A better explanation may be that the garbage collector cares about the pointed-to object remaining at the same address but not about its contents changing (we can't guarantee the latter at the C level). |
Closes #6656
Thanks for looking into this @aitap! I think the PR here is the best option.
xd
is notconst
because of this:data.table/src/chmatch.c
Line 117 in a599557
_RO
accessors for the otherSEXPTYPE
s is correct --valP
is only ever read from (and its value coerced before writing toval
).