Skip to content

Fix offsets and bounds in partial attribute comparisons - #79

Merged
jcmosc merged 1 commit into
jcmosc:mainfrom
OpenSwiftUIProject:fix/partial-comparison
Oct 13, 2026
Merged

jcmosc merged 1 commit into
jcmosc:mainfrom
OpenSwiftUIProject:fix/partial-comparison

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Partial attribute comparisons can use an offset from the start of the layout after their value pointers already include the requested offset. This can copy a nontrivial enum from the wrong address and crash in swift_retain, or compare bytes outside the requested field.

Return the layout offset relative to the requested range and clamp it to the range size. Add four regression tests for enum payloads and case changes, custom equality, and field boundaries.

Fixes #78.

Validation

  • All 106 targeted Compute tests passed.
  • All four new regression tests passed against AttributeGraph.

@jcmosc
jcmosc merged commit 9ae567c into jcmosc:main Oct 13, 2026
2 checks passed
@jcmosc

jcmosc commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Thanks!

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.

Partial attribute comparison can copy an enum from the wrong address

2 participants