Skip to content

fix: Adjust recursive cycle detection to fix EXC_BAD_ACCESS#181

Open
maximkrouk wants to merge 1 commit intoGraphQLSwift:mainfrom
CaptureContext:main
Open

fix: Adjust recursive cycle detection to fix EXC_BAD_ACCESS#181
maximkrouk wants to merge 1 commit intoGraphQLSwift:mainfrom
CaptureContext:main

Conversation

@maximkrouk
Copy link
Copy Markdown

@maximkrouk maximkrouk commented Apr 14, 2026

Prev implementation triggered EXC_BAD_ACCESS exception on line 711

fieldPathIndexByTypeName[inputObj.name] = fieldPath.count could not access count since fieldPath was <uninitialized> even tho it clearly was

This commit wraps this logic into a class so createInputObjectCircularRefsValidator function no longer mutably captures a value type

Note

I also added .editorconfig file, this will help potential contributors to avoid switching their default formatting to "4-spaces" while working on graphql package

Prev implementation triggered EXC_BAD_ACCESS exception on line 711

> `fieldPathIndexByTypeName[inputObj.name] = fieldPath.count` could not access `count` since `fieldPath` was `<uninitialized>` even tho it clearly was

This commit wraps this logic into a class so `createInputObjectCircularRefsValidator` function no longer mutably captures a value type
}

visitedTypes.insert(inputObj)
fieldPathIndexByTypeName[inputObj.name] = fieldPath.count
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exception was raised here on fieldPath.count access, for some reason it was only reproducible in release builds, debug ones worked fine 💁‍♂️

@maximkrouk maximkrouk changed the title fix: Adjust recursive cycle detection fix: Adjust recursive cycle detection to fix EXC_BAD_ACCESS Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant