1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

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 9e804e0c21)
This commit is contained in:
Jelmer Vernooij 2007-09-15 23:03:34 +00:00 committed by Gerald (Jerry) Carter
parent ae9c015c57
commit 2e3768843a
2 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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" } ]}));