Skip to content

[CherryPick][DWARFVerifier] Fix verification of empty line tables (#81162) #8163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

felipepiovezan
Copy link

A line table whose sole entry is an end sequence should not have the entry's file index verified, as that value corresponds to the initial value of the state machine, not to a real file index. In DWARF 5, this is particularly problematic as it uses 0-based indexing, and the state machine specifies a starting index of 1; in other words, you'd need to have two files before such index became legal "by default".

A previous attempt to fix this problem was done 1, but it was too specific in its condition, and did not capture all possible cases where this issue can happen.

(cherry picked from commit 1d4fc38)

A line table whose sole entry is an end sequence should not have the
entry's file index verified, as that value corresponds to the initial
value of the state machine, not to a real file index. In DWARF 5, this
is particularly problematic as it uses 0-based indexing, and the state
machine specifies a starting index of 1; in other words, you'd need to
have _two_ files before such index became legal "by default".

A previous attempt to fix this problem was done [1], but it was too
specific in its condition, and did not capture all possible cases where
this issue can happen.

[1]: llvm#77004

(cherry picked from commit 1d4fc38)
@felipepiovezan
Copy link
Author

@swift-ci smoke test

@felipepiovezan
Copy link
Author

@swift-ci test

@felipepiovezan felipepiovezan merged commit 6982ea8 into swiftlang:stable/20230725 Feb 9, 2024
@felipepiovezan felipepiovezan deleted the felipe/cherry-pick-empty-line-tables branch February 9, 2024 20:28
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