Skip to content

Conversation

@DanBlackwell
Copy link

In Swift codegen, allocas are memset to zero before their lifetime.start. This is done so that lldb can display a friendly 'var is uninitialized' message rather than displaying garbage. The stack-tagging pass results in this memset using the tagged pointer, before the memory has been tagged - resulting in a tag fault.

This patch works around this by detecting when one of these memsets is present (using metadata added during Swift codegen), and moving the tagging after. This results in the memset using the untagged pointer, before the memory is tagged.

Paired with: swiftlang/swift#85558.

rdar://162206592

In Swift codegen, allocas are memset to zero before their lifetime.start. This is done so that lldb can display a friendly 'var is uninitialized' message rather than displaying garbage. The stack-tagging pass results in this memset using the tagged pointer, before the memory has been tagged - resulting in a tag fault.

This patch works around this by detecting when one of these memsets is present (using metadata added during Swift codegen), and moving the tagging after. This results in the memset using the untagged pointer, before the memory is tagged.

rdar://162206592
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