mirror of
https://github.com/apache/thrift.git
synced 2026-10-28 16:35:10 +08:00
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>