diff options
Diffstat (limited to 'source4/pidl')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/NDR.pm | 10 | ||||
-rwxr-xr-x | source4/pidl/tests/ndr.pl | 4 |
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" } ]})); |