From e8712bebae30f4f041643ce36177a321f12c23e5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 12 Sep 2007 12:31:19 +0000 Subject: r25114: handle structs and unions without typedefs better in can_contain_deffered() jelmer: we need to handle this more genericly, I assume we have a lot of other related bugs metze (This used to be commit 3e0f22c85769cac7a5f439836be7b692259ddd81) --- source4/pidl/lib/Parse/Pidl/NDR.pm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'source4') diff --git a/source4/pidl/lib/Parse/Pidl/NDR.pm b/source4/pidl/lib/Parse/Pidl/NDR.pm index 11fdbb2390..0ec4e6523b 100644 --- a/source4/pidl/lib/Parse/Pidl/NDR.pm +++ b/source4/pidl/lib/Parse/Pidl/NDR.pm @@ -288,9 +288,20 @@ sub can_contain_deferred($) return 1 if ($type->{TYPE} eq "DECLARE"); # assume the worst - foreach my $x (@{$type->{DATA}->{ELEMENTS}}) { - return 1 if ($x->{POINTERS}); - return 1 if (can_contain_deferred ($x)); + if ($type->{TYPE} eq "TYPEDEF") { + return 0 unless defined($type->{DATA}->{ELEMENTS}); + + foreach my $x (@{$type->{DATA}->{ELEMENTS}}) { + return 1 if ($x->{POINTERS}); + return 1 if (can_contain_deferred ($x)); + } + } else { + return 0 unless defined($type->{ELEMENTS}); + + foreach my $x (@{$type->{ELEMENTS}}) { + return 1 if ($x->{POINTERS}); + return 1 if (can_contain_deferred ($x)); + } } return 0; -- cgit