Skip to content

Commit 81fc6d5

Browse files
Jens-Gclaude
andcommitted
Fix parent class resolution in c_glib generated dispatch_call
Client: c_glib Use g_type_class_peek() with the processor type ID instead of GET_CLASS(self) when looking up the parent class in generated dispatch_call. GET_CLASS(self) returns the runtime class of the instance, which may differ from the class defining the method when service inheritance is used, leading to incorrect dispatch. (10) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e703c7b commit 81fc6d5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

compiler/cpp/src/thrift/generate/t_c_glib_generator.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2594,8 +2594,8 @@ void t_c_glib_generator::generate_service_processor(t_service* tservice) {
25942594
f_service_ << indent() << parent_class_name << "Class "
25952595
"*parent_class =" << '\n';
25962596
indent_up();
2597-
f_service_ << indent() << "g_type_class_peek_parent (" << class_name_uc << "_GET_CLASS (self));"
2598-
<< '\n';
2597+
f_service_ << indent() << "g_type_class_peek_parent (g_type_class_peek ("
2598+
<< class_name_lc << "_get_type ()));" << '\n';
25992599
indent_down();
26002600
f_service_ << '\n'
26012601
<< indent() << "process_function_def = "

0 commit comments

Comments
 (0)