-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Reflection Library crash inspecting certain BoundGeneric types #32983
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
Reflection Library crash inspecting certain BoundGeneric types #32983
Conversation
If the parent of a BoundGeneric type is not a NominalType (for example, if the Parent was an ObjCClass type) the `getDepth()` method would end up reading a Parent reference from uninitialized memory. The resulting garbage pointer would cause a crash in the tool that was using the reflection library (leaks, instruments, etc.) Of course, this does not always result in a crash, since the memory in question is frequently zeroed, resulting in a nil pointer that is safely detected. Resolves rdar://54173375
@swift-ci Please test |
Build failed |
@swift-ci Please test |
Build failed |
Build failed |
@swift-ci Please test Linux |
Build failed |
@swift-ci Please smoke test Linux |
@swift-ci Please smoke test |
@swift-ci Please test |
Build failed |
…lang#32983) * Reflectio Library crash inspecting certain BoundGeneric types If the parent of a BoundGeneric type is not a NominalType (for example, if the Parent was an ObjCClass type) the `getDepth()` method would end up reading a Parent reference from uninitialized memory. The resulting garbage pointer would cause a crash in the tool that was using the reflection library (leaks, instruments, etc.) Of course, this does not always result in a crash, since the memory in question is frequently zeroed, resulting in a nil pointer that is safely detected. Resolves rdar://54173375 * Fix compile
… (#33008) * Reflectio Library crash inspecting certain BoundGeneric types If the parent of a BoundGeneric type is not a NominalType (for example, if the Parent was an ObjCClass type) the `getDepth()` method would end up reading a Parent reference from uninitialized memory. The resulting garbage pointer would cause a crash in the tool that was using the reflection library (leaks, instruments, etc.) Of course, this does not always result in a crash, since the memory in question is frequently zeroed, resulting in a nil pointer that is safely detected. Resolves rdar://54173375 * Fix compile
If the parent of a BoundGeneric type is not a NominalType (for example, if the
Parent was an ObjCClass type) the
getDepth()
method would end up reading aParent reference from uninitialized memory. The resulting garbage pointer
would cause a crash in the tool that was using the reflection library
(leaks, instruments, etc.)
Of course, this does not always result in a crash, since the memory in question
is frequently zeroed, resulting in a nil pointer that is safely detected.
This changes
getDepth()
to detect unrecognized types and return zero.Resolves rdar://54173375