From 138461634ecf9b66b28484cddb1cedd68be6d029 Mon Sep 17 00:00:00 2001 From: jj Date: Thu, 3 May 2012 19:19:58 +0200 Subject: [PATCH] ruby: fix vtable for linux destructor --- plugins/ruby/codegen.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/ruby/codegen.pl b/plugins/ruby/codegen.pl index 079410791..81ca15137 100755 --- a/plugins/ruby/codegen.pl +++ b/plugins/ruby/codegen.pl @@ -201,7 +201,7 @@ sub render_global_class { push @lines_rb, "sizeof $sz"; push @lines_rb, "rtti_classname :$rtti_name" if $rtti_name; render_struct_fields($type, "$cppns"); - my $vms = $type->findnodes('child::virtual-methods')->[0]; + my $vms = $type->findnodes('child::virtual-methods')->[0]; render_class_vmethods($vms) if $vms; }; push @lines_rb, "end\n"; @@ -243,9 +243,10 @@ sub render_class_vmethods { }; push @lines_rb, 'end'; } + # on linux, the destructor uses 2 entries + $voff += 4 if $meth->getAttribute('is-destructor') and $^O =~ /linux/i; $voff += 4; } - } sub render_global_objects {