You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unified: Support Swift borrow, consume, copy, and unsafe expressions - #23104
paldepind
changed the title
Unified: Support Swift borrow, consume, copy, and unsafe expressions
Unified: Support Swift borrow, consume, copy, and unsafe expressions
Nov 11, 2026
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The new Swift unary operators lack operand value propagation in unified data flow, causing flows through borrow, consume, copy, and unsafe to stop at the wrapper and leaving a gap in security analyses.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The new wrappers propagate value flow but not operand types, causing unannotated declarations to lose inferred receiver types and breaking subsequent member or method resolution.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Propagate operand types through all four copy operators
Value flow now passes through these wrappers, but neither TypeInferencePluginSwift.qll::inferType nor TypeInference.qll::stepLanguageSpecific propagates their operand types. Consequently, an unannotated declaration such as let copied = copy original loses the inferred receiver type needed to resolve subsequent instance member accesses or method calls. Propagate operand types, including generic type paths, through all four operators and add type-inference/member-resolution regression tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Just like how
awaitandtryare mapped tounary_exprthis PR does the same forborrow,consume,copy, andunsafeexpressions.