[
https://issues.apache.org/jira/browse/THRIFT-6050?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jens Geyer resolved THRIFT-6050.
--------------------------------
Assignee: Jens Geyer
Resolution: Won't Fix
h2. 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.
> Limit struct read/write recursion depth in Swift library
> --------------------------------------------------------
>
> Key: THRIFT-6050
> URL: https://issues.apache.org/jira/browse/THRIFT-6050
> Project: Thrift
> Issue Type: Bug
> Components: Swift - Library
> Reporter: Jens Geyer
> Assignee: Jens Geyer
> Priority: Major
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> The Swift library does not limit struct read/write recursion depth. A deeply
> nested message can exhaust the call stack. Add recursion depth tracking to
> the protocol base and emit guards from the generated struct read and write
> methods.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)