-
Notifications
You must be signed in to change notification settings - Fork 10.5k
runtime: Fix overflow of swift_unownedRetain reference counts #11290
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
runtime: Fix overflow of swift_unownedRetain reference counts #11290
Conversation
@swift-ci Please test |
Build failed |
Build failed |
Unrelated error:
|
@swift-ci Please test |
1 similar comment
@swift-ci Please test |
Build failed |
ebba3dc
to
9a75101
Compare
Build failed |
9a75101
to
ada35ce
Compare
@swift-ci Please test |
Build failed |
Build failed |
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.
LGTM!
Thanks for the fix!
stdlib/public/SwiftShims/RefCount.h
Outdated
// Check overflow and use the side table on overflow. | ||
if (newbits.getUnownedRefCount() != oldValue + inc) | ||
return incrementUnownedSlow(inc); | ||
|
||
// FIXME: overflow check? |
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.
nitpick: you should remove the FIXME (maybe in a follow-up commit)
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.
Yes. I noticed it too. I am going to do it in a follow up.
ada35ce
to
684bbd6
Compare
On 32bit platforms there are 7 bits reserved for the unowned retain count. This makes overflow a likely scenario. Implement overflow into the side table. rdar://33495003
684bbd6
to
d8abd2f
Compare
@swift-ci Please test |
Build failed |
Build failed |
On 32bit platforms there are 7 bits reserved for the unowned retain count. This
makes overflow a likely scenario. Implement overflow into the side table.
rdar://33495003