Skip to content

Fix crash in CanConvert from incomplete type#8110

Open
tex3d wants to merge 2 commits intomicrosoft:mainfrom
tex3d:fix-incomplete-target-in-CanConvert
Open

Fix crash in CanConvert from incomplete type#8110
tex3d wants to merge 2 commits intomicrosoft:mainfrom
tex3d:fix-incomplete-target-in-CanConvert

Conversation

@tex3d
Copy link
Contributor

@tex3d tex3d commented Jan 28, 2026

A crash could be triggered in IsHLSLCopyableAnnotatableRecord when checking whether an explicit cast would be allowed for diagnostics, when adding function overload candidates with an incomplete target param type, and the source type is a basic type that supports splat to record type.

Fixed by attempting to complete the type in CanConvert before calling IsHLSLNumericOrAggregateOfNumericType (which calls IsHLSLCopyableAnnotatableRecord). If it fails to complete, it will harmlessly skip this case.

…e selection

A crash could be triggered in IsHLSLCopyableAnnotatableRecord when checking whether an explicit cast would be allowed for diagnostics, when adding function overload candidates with an incomplete target param type, and the source type is a basic type that supports splat to record type.

Fixed by attempting to complete the type in CanConvert before calling IsHLSLNumericOrAggregateOfNumericType (which calls IsHLSLCopyableAnnotatableRecord). If it fails to complete, it will harmlessly skip this case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

2 participants