summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Samba4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-01-31 15:04:22 +0100
committerStefan Metzmacher <metze@samba.org>2008-02-07 08:33:18 +0100
commite7c178629fcf13fc5e008ebb98ca55583aa65ffe (patch)
treeea488a7660f3c80b97d93b873c4d31bbeef0c065 /source4/pidl/lib/Parse/Pidl/Samba4
parentc713b58a00b7cb5ef34b101ba5b74c8d9ec505ba (diff)
downloadsamba-e7c178629fcf13fc5e008ebb98ca55583aa65ffe.tar.gz
samba-e7c178629fcf13fc5e008ebb98ca55583aa65ffe.tar.bz2
samba-e7c178629fcf13fc5e008ebb98ca55583aa65ffe.zip
pidl/Samba4::NDR::Parser: fix support for embedded "ref" pointers
The memory allocation of embedded "ref" pointers needs to be the same as for all other embedded pointers. metze (This used to be commit 6b3817c2250b94307ffcbd9f8eeb9a593eb7a82d)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba4')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm14
1 files changed, 7 insertions, 7 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
index 81a8bf88cd..6e6d227681 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
@@ -929,7 +929,7 @@ sub ParseMemCtxPullFlags($$$$)
($nl->{DATA_TYPE} eq "string"));
if ($next_is_array or $next_is_string) {
return undef;
- } else {
+ } elsif ($l->{LEVEL} eq "TOP") {
$mem_flags = "LIBNDR_FLAG_REF_ALLOC";
}
}
@@ -1129,10 +1129,7 @@ sub ParsePtrPull($$$$$)
my $next_is_string = (($nl->{TYPE} eq "DATA") and
($nl->{DATA_TYPE} eq "string"));
- if ($l->{POINTER_TYPE} eq "ref") {
- if ($l->{LEVEL} eq "EMBEDDED") {
- $self->pidl("NDR_CHECK(ndr_pull_ref_ptr($ndr, &_ptr_$e->{NAME}));");
- }
+ if ($l->{POINTER_TYPE} eq "ref" and $l->{LEVEL} eq "TOP") {
if (!$next_is_array and !$next_is_string) {
$self->pidl("if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {");
@@ -1141,16 +1138,19 @@ sub ParsePtrPull($$$$$)
}
return;
+ } elsif ($l->{POINTER_TYPE} eq "ref" and $l->{LEVEL} eq "EMBEDDED") {
+ $self->pidl("NDR_CHECK(ndr_pull_ref_ptr($ndr, &_ptr_$e->{NAME}));");
} elsif (($l->{POINTER_TYPE} eq "unique") or
($l->{POINTER_TYPE} eq "relative") or
($l->{POINTER_TYPE} eq "full")) {
$self->pidl("NDR_CHECK(ndr_pull_generic_ptr($ndr, &_ptr_$e->{NAME}));");
- $self->pidl("if (_ptr_$e->{NAME}) {");
- $self->indent;
} else {
die("Unhandled pointer type $l->{POINTER_TYPE}");
}
+ $self->pidl("if (_ptr_$e->{NAME}) {");
+ $self->indent;
+
# Don't do this for arrays, they're allocated at the actual level
# of the array
unless ($next_is_array or $next_is_string) {