Skip to content
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

[ASTextNode] Fix a deadlock that could occur when enabling experimental ASTextNode2 via ASConfiguration #903

Merged
merged 1 commit into from
May 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Source/ASTextNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1324,8 +1324,9 @@ + (id)allocWithZone:(struct _NSZone *)zone
// We are descended from ASTextNode. We need to change the superclass for the
// ASTextNode subclass to ASTextNode2.
// Walk up the class hierarchy until we find ASTextNode.
// Note: This may be called on multiple threads simultaneously.
Class s;
for (Class c = self; c != [ASTextNode class]; c = s) {
for (Class c = self; c != Nil && c != [ASTextNode class]; c = s) {
s = class_getSuperclass(c);
if (s == [ASTextNode class]) {
#pragma clang diagnostic push
Expand Down