diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-03-09 15:39:55 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:11:00 -0500 |
commit | 961148db3127a0e3785a5389f24aa25e23d87f43 (patch) | |
tree | 45e5e8bf7db032944ec7b98a7c3a7b5ba6cdc0e8 /source4 | |
parent | 1bbaa12437f3703728a4755c49a14ecdabbbd7da (diff) | |
download | samba-961148db3127a0e3785a5389f24aa25e23d87f43.tar.gz samba-961148db3127a0e3785a5389f24aa25e23d87f43.tar.bz2 samba-961148db3127a0e3785a5389f24aa25e23d87f43.zip |
r5709: Leave out the pull/push call with NDR_BUFFERS for not just
scalars but also for structs/unions containing only scalars.
(This used to be commit a3e136b2f3bd51159775fea25eff0ea81e9716f7)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/build/pidl/ndr.pm | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/source4/build/pidl/ndr.pm b/source4/build/pidl/ndr.pm index fce7f26f93..fcd6f6d6dd 100644 --- a/source4/build/pidl/ndr.pm +++ b/source4/build/pidl/ndr.pm @@ -171,8 +171,7 @@ sub need_wire_pointer($) sub need_buffers_section($) { my $e = shift; - if ((is_scalar_type($e->{TYPE}) || util::has_property($e, "subcontext")) && - $e->{POINTERS} == 0 && + if (!can_contain_deferred($e) && !util::array_size($e)) { return 0; } @@ -408,6 +407,26 @@ sub align_type } ##################################################################### +# see if a type contains any deferred data +sub can_contain_deferred +{ + my $e = shift; + + return 1 if ($e->{POINTERS}); + return 0 if (is_scalar_type($e->{TYPE})); + return 0 if (util::has_property($e, "subcontext")); + return 1 unless (typelist::hasType($e->{TYPE})); # assume the worst + + my $type = typelist::getType($e->{TYPE}); + + foreach my $x (@{$type->{DATA}->{ELEMENTS}}) { + return 1 if (can_contain_deferred ($x)); + } + + return 0; +} + +##################################################################### # parse array preceding data - push side sub ParseArrayPushPreceding($$$) { |