-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Make constants immortal #3063
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
Make constants immortal #3063
Conversation
@swift-ci test |
Is there any way we can verify this with a test case? |
@parkera I think there might be. It's not going to be pretty, but I think I can make it work. |
rdar://82441851
886ece7
to
1a3b9a3
Compare
@swift-ci test |
let trueRefCount = truePtr.advanced(by: 1).pointee | ||
let falseRefCount = falsePtr.advanced(by: 1).pointee | ||
|
||
XCTAssertEqual(trueRefCount, falseRefCount) |
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 not sure we need to actually verify the reference count, so much as verify that releasing it a bunch then using it doesn't crash.
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.
It's actually important that it doesn't change. Otherwise we are just masking the problem by assigning a very high ref count.
rdar://82441851