summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-05-21 15:01:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:18 -0500
commit8fef2c8122a8d8ca522356353d30ed25dfd4c8fe (patch)
tree625d0f390e160fc5473dc014f8585b8a220a2aa8 /source4
parent151713d694508ce5af39aebbb00ace214361732b (diff)
downloadsamba-8fef2c8122a8d8ca522356353d30ed25dfd4c8fe.tar.gz
samba-8fef2c8122a8d8ca522356353d30ed25dfd4c8fe.tar.bz2
samba-8fef2c8122a8d8ca522356353d30ed25dfd4c8fe.zip
r15778: Fix bug printing ref pointers.
(This used to be commit 030272e79b621c2c54354f4c89cc25c202d2dbbc)
Diffstat (limited to 'source4')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm20
1 files changed, 12 insertions, 8 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
index 5a8ef53e14..2797c6c490 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
@@ -702,13 +702,15 @@ sub ParseElementPrint($$$)
foreach my $l (@{$e->{LEVELS}}) {
if ($l->{TYPE} eq "POINTER") {
+ if ($l->{POINTER_TYPE} ne "ref" or has_property($e, "keepref")) {
pidl "ndr_print_ptr(ndr, \"$e->{NAME}\", $var_name);";
pidl "ndr->depth++;";
- if ($l->{POINTER_TYPE} ne "ref") {
- pidl "if ($var_name) {";
- indent;
+ if ($l->{POINTER_TYPE} ne "ref") {
+ pidl "if ($var_name) {";
+ indent;
+ }
+ $var_name = get_value_of($var_name);
}
- $var_name = get_value_of($var_name);
} elsif ($l->{TYPE} eq "ARRAY") {
my $length;
@@ -757,11 +759,13 @@ sub ParseElementPrint($$$)
foreach my $l (reverse @{$e->{LEVELS}}) {
if ($l->{TYPE} eq "POINTER") {
- if ($l->{POINTER_TYPE} ne "ref") {
- deindent;
- pidl "}";
+ if ($l->{POINTER_TYPE} ne "ref" or has_property($e, "keepref")) {
+ if ($l->{POINTER_TYPE} ne "ref") {
+ deindent;
+ pidl "}";
+ }
+ pidl "ndr->depth--;";
}
- pidl "ndr->depth--;";
} elsif (($l->{TYPE} eq "ARRAY")
and not is_charset_array($e,$l)
and not has_fast_array($e,$l)) {