Files
Sylwester LachiewiczandClaude Opus 5 874dafc784 THRIFT-6332: Render struct, typedef and nested container constants in the Graphviz generator
Client: gv

print_const_value cast the declared type of a constant to t_map, t_list
or t_set by the shape of the value without checking the type. A struct
literal is a map value over a t_struct and a typedef of a container is a
t_typedef, so the cast read out of bounds; an enum identifier or a nested
container under the wrong type then dereferenced the garbage and the
compiler crashed. test/DebugProtoTest.thrift and test/EnumTest.thrift
crash --gen gv today.

The value's shape now follows the resolved type, and a struct literal is
walked field by field with each field's own type. Keys keep the quoted
rendering the surviving cases had, so the 154 repository IDL files that
did not crash produce identical output.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 18:57:40 +02:00
..