diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-09-12 12:31:19 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:06:42 -0500 |
commit | e8712bebae30f4f041643ce36177a321f12c23e5 (patch) | |
tree | 30c6d42386cf6dd14bedbb9b384dfd4a76f572bf /source4/pidl/lib/Parse | |
parent | 49f4f8ea2c8c209a6d97911d58a00f1947e867fd (diff) | |
download | samba-e8712bebae30f4f041643ce36177a321f12c23e5.tar.gz samba-e8712bebae30f4f041643ce36177a321f12c23e5.tar.bz2 samba-e8712bebae30f4f041643ce36177a321f12c23e5.zip |
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)
Diffstat (limited to 'source4/pidl/lib/Parse')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/NDR.pm | 17 |
1 files changed, 14 insertions, 3 deletions
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; |