Skip to content

Conversation

@hamishknight
Copy link
Contributor

No description provided.

`walkToTypeReprPost` should return `true` to keep
walking, so we really want to check if the
`offendingType` hasn't been found yet. Otherwise
we'll bail as soon as we visit the first type.
Turns out we were getting away with dereferencing
`nullptr` in a few cases as `walk` would use
`nullptr` to indicate that the walk should be
stopped, and luckily Clang didn't optimize it to
something broken.

This commit is fairly defensive and sprinkles
some null checks for calls to `walk` directly
on a body of a function or top-level code decl.
Replace the use of bool and pointer returns for
`walkToXXXPre`/`walkToXXXPost`, and instead use
explicit actions such as `Action::Continue(E)` and
`Action::Stop()`.
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight
Copy link
Contributor Author

@swift-ci please test source compatibility

@hamishknight
Copy link
Contributor Author

@swift-ci please SourceKit stress test

@hamishknight
Copy link
Contributor Author

swiftlang/llvm-project#5238

@swift-ci please test

@hamishknight hamishknight deleted the walk-this-way branch September 5, 2022 13:57
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