Closed swift-ci closed 4 years ago
@swift-ci create
@ahoppen fixed this in https://github.com/apple/swift-syntax/pull/205 but swift-format is using a snapshot tag that is prior to this improvement.
I think this is a case where swift-format needs to update the SwiftSyntax dependency.
\cc @allevato
I've just cut the swift-5.2-branch
of swift-format which depends on swift-syntax 0.50200.0, which contains the above fix. The master
branch is also using 0.50200.0 for the time being, so it will work there as well.
Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | swift-format | |Labels | Bug | |Assignee | @allevato | |Priority | Medium | md5: 4111fa0935f36cb69278ce6ab26c299cIssue Description:
Stack overflow 2: revenge of the rdar://55929175
After implementing formatting in sourcekit-lsp I was investigating why it wasn't working for things that are nested four levels deep. After fighting with debugger, I had a hunch that it may be stack overflow. I found a comment in the function that was crashing:
It crashes only in debug mode, on macos
To reproduce:
clone https://github.com/Trzyipolkostkicukru/sourcekit-lsp/tree/format and checkout commit ed642036f4b9ce7696ad340523ed8e9b4bdb9761
get toolchain swift-DEVELOPMENT-SNAPSHOT-2020-01-29-a and set it as your compiler
compile and set up sourcekit-lsp
try to format a file with 4+ levels of nesting, for example: