You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@thrift.apache.org by "Jens-G (via GitHub)" <gi...@apache.org> on 2026/05/28 11:46:47 UTC
[PR] THRIFT-6050: Limit struct read/write recursion depth in Swift library [thrift]
Jens-G opened a new pull request, #3555:
URL: https://github.com/apache/thrift/pull/3555
## Summary
- Adds recursion depth counter to Swift `TProtocol` base
- Limit is 64; throws `TProtocolError` with `.depthLimit` when exceeded
- Swift generator wraps struct read/write with `defer` to guarantee decrement
## Test plan
- [ ] Unit tests in `lib/swift/Tests/` verify depth allow/reject/restore
🤖 Generated with [Claude Code](https://claude.ai/claude-code)
Co-Authored-By: Claude Sonnet 4.6 <no...@anthropic.com>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] THRIFT-6050: Limit struct read/write recursion depth in Swift library [thrift]
Posted by "Jens-G (via GitHub)" <gi...@apache.org>.
Jens-G closed pull request #3555: THRIFT-6050: Limit struct read/write recursion depth in Swift library
URL: https://github.com/apache/thrift/pull/3555
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] THRIFT-6050: Limit struct read/write recursion depth in Swift library [thrift]
Posted by "Jens-G (via GitHub)" <gi...@apache.org>.
Jens-G commented on PR #3555:
URL: https://github.com/apache/thrift/pull/3555#issuecomment-4590491497
## Problems:
### The generated recursive types are mostly unusable in Swift
- pre-existing, not part of THRIFT-6050
- CoUnion/CoUnion2 don't even compile — recursive Swift enums must be marked indirect; the generator doesn't. (Confirmed with the compiler.)
- CoRec/CoError/RecList have non-optional recursive fields (var other: CoError2, required init param) → they can never be constructed (no base case to
bootstrap).
- Only RecTree (list-of-self, list can be empty) is actually constructible.
### No CI gate: broken and disabled CI
- THRIFT-5864 — "broken, no maintainers"
- Package is swift-tools:5.1 (no build plugins),
## Decision
Bad day for Swift. Close the PR and fugetabodit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org