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:
parent
ae9c015c57
commit
2e3768843a
@ -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;
|
||||
|
@ -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" } ]}));
|
||||
|
Loading…
Reference in New Issue
Block a user