From a9cdc6321ac1aeafae6200afefd12f83c5786868 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 30 Nov 2005 17:07:02 +0000 Subject: r11974: only look at $pl->{POINTER_TYPE} when $pl is defined metze (This used to be commit 271d0af16d50bc89a384b56db70d569914273f6c) --- source4/pidl/lib/Parse/Pidl/Samba/NDR/Parser.pm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'source4/pidl/lib/Parse') diff --git a/source4/pidl/lib/Parse/Pidl/Samba/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba/NDR/Parser.pm index 05946b44f5..84f3091586 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba/NDR/Parser.pm @@ -2019,15 +2019,14 @@ sub AllocateArrayLevel($$$$$) pidl "if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {"; pidl "\tNDR_PULL_ALLOC_N($ndr, $var, $size);"; pidl "}"; - } else { - pidl "NDR_PULL_ALLOC_N($ndr, $var, $size);"; + if (grep(/in/,@{$e->{DIRECTION}}) and + grep(/out/,@{$e->{DIRECTION}})) { + pidl "memcpy(r->out.$e->{NAME},r->in.$e->{NAME},$size * sizeof(*r->in.$e->{NAME}));"; + } + return; } - if (grep(/in/,@{$e->{DIRECTION}}) and - grep(/out/,@{$e->{DIRECTION}}) and - $pl->{POINTER_TYPE} eq "ref") { - pidl "memcpy(r->out.$e->{NAME},r->in.$e->{NAME},$size * sizeof(*r->in.$e->{NAME}));"; - } + pidl "NDR_PULL_ALLOC_N($ndr, $var, $size);"; } ##################################################################### -- cgit