From 456f3b378d79a32b3092a0f8e11c81ed29f89ddd Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 17 Aug 2007 13:45:18 +0000 Subject: r24522: make the "skip pointer to an array" logic a bit easier metze (This used to be commit a698fb18573baf016009bdd2d02aaf336dc92a63) --- source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'source4/pidl') diff --git a/source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm b/source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm index d6311ed360..cc5057aef4 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm @@ -65,18 +65,16 @@ sub AllocOutVar($$$$) my ($e, $mem_ctx, $name, $env) = @_; my $l = $e->{LEVELS}[0]; - my $nl = $l; + # we skip pointer to arrays if ($l->{TYPE} eq "POINTER") { - $nl = GetNextLevel($e, $l); + my $nl = GetNextLevel($e, $l); + $l = $nl if ($nl->{TYPE} eq "ARRAY"); } if ($l->{TYPE} eq "ARRAY") { my $size = ParseExpr($l->{SIZE_IS}, $env, $e); pidl "$name = talloc_zero_array($mem_ctx, " . DeclLevel($e, 1) . ", $size);"; - } elsif ($l->{TYPE} eq "POINTER" and $nl->{TYPE} eq "ARRAY") { - my $size = ParseExpr($nl->{SIZE_IS}, $env, $e); - pidl "$name = talloc_zero_array($mem_ctx, " . DeclLevel($e, 1) . ", $size);"; } else { pidl "$name = talloc_zero($mem_ctx, " . DeclLevel($e, 1) . ");"; } -- cgit