summaryrefslogtreecommitdiff
path: root/source4/pidl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-09-15 23:03:34 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:06:47 -0500
commit2e3768843ae8a202e0a3a60224f6717fc34499ab (patch)
tree0f7ec9a44d6ff12e6f058c6959f0bbe879236959 /source4/pidl
parentae9c015c570d4a34cb8023aef4164437f5ae7131 (diff)
downloadsamba-2e3768843ae8a202e0a3a60224f6717fc34499ab.tar.gz
samba-2e3768843ae8a202e0a3a60224f6717fc34499ab.tar.bz2
samba-2e3768843ae8a202e0a3a60224f6717fc34499ab.zip
r25185: Check that can_contain_deferred returns true if one of the members of a type can contain deferred data.
(This used to be commit 9e804e0c21f09b699707bb88d534bde55d265087)
Diffstat (limited to 'source4/pidl')
-rw-r--r--source4/pidl/lib/Parse/Pidl/NDR.pm10
-rwxr-xr-xsource4/pidl/tests/ndr.pl4
2 files changed, 7 insertions, 7 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/NDR.pm b/source4/pidl/lib/Parse/Pidl/NDR.pm
index 033217c8bf..f624d2bdc0 100644
--- a/source4/pidl/lib/Parse/Pidl/NDR.pm
+++ b/source4/pidl/lib/Parse/Pidl/NDR.pm
@@ -289,15 +289,13 @@ sub can_contain_deferred($)
return 1 if ($type->{TYPE} eq "DECLARE"); # assume the worst
- if ($type->{TYPE} eq "TYPEDEF") {
- return can_contain_deferred($type->{DATA});
- }
+ return can_contain_deferred($type->{DATA}) if ($type->{TYPE} eq "TYPEDEF");
return 0 unless defined($type->{ELEMENTS});
- foreach my $x (@{$type->{ELEMENTS}}) {
- return 1 if ($x->{POINTERS});
- return 1 if (can_contain_deferred ($x));
+ foreach (@{$type->{ELEMENTS}}) {
+ return 1 if ($_->{POINTERS});
+ return 1 if (can_contain_deferred ($_->{TYPE}));
}
return 0;
diff --git a/source4/pidl/tests/ndr.pl b/source4/pidl/tests/ndr.pl
index 6e91ad2a6a..1512f19d52 100755
--- a/source4/pidl/tests/ndr.pl
+++ b/source4/pidl/tests/ndr.pl
@@ -4,7 +4,7 @@
use strict;
use warnings;
-use Test::More tests => 33;
+use Test::More tests => 34;
use FindBin qw($RealBin);
use lib "$RealBin";
use Util;
@@ -266,3 +266,5 @@ ok(not can_contain_deferred({ TYPE => "STRUCT",
ok(not can_contain_deferred({ TYPE => "TYPEDEF",
DATA => { TYPE => "STRUCT",
ELEMENTS => [ { TYPE => "uint32" } ]}}));
+ok(can_contain_deferred({ TYPE => "STRUCT",
+ ELEMENTS => [ { TYPE => "someunknowntype" } ]}));