Jens-G opened a new pull request, #3568:
URL: https://github.com/apache/thrift/pull/3568

   Follow-up to the D recursion-depth limit (#3558). `test/Recursive.thrift` 
now also defines a recursive `union` and `exception`. D can't consume that file 
(its `CoRec`/`CoRec2`/`RecList` recurse by value and aren't expressible as D 
aggregates), so the D test stays self-contained in `base.d`.
   
   A generated Thrift exception is a `class : TException` carrying the same 
`mixin TStructHelpers`, so its `read()`/`write()` forward to the same guarded 
`readStruct`/`writeStruct` as a struct. This adds a parallel `unittest` over a 
recursive exception (`RecError`):
   
   - at-limit round-trip (off-by-one / no double-count),
   - over-limit write → `DEPTH_LIMIT`,
   - crafted over-limit read (raw primitives, field id 1 / `TType.LIST`, so it 
routes through the guarded `readStruct` and not the unbounded `skip()`) → 
`DEPTH_LIMIT`.
   
   Thrift unions generate as plain structs in D, so the existing `RecTree` 
struct case already covers them.
   
   Test-only change. Validated locally with DMD in the `thrift:jammy` image: 
all 7 `base.d` unittests pass.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to