pidl/NDR/Parser: declare all union helper variables in ParseUnionPull()
authorStefan Metzmacher <metze@samba.org>
Thu, 15 Mar 2012 12:09:51 +0000 (13:09 +0100)
committerKarolin Seeger <kseeger@samba.org>
Sat, 7 Apr 2012 13:58:44 +0000 (15:58 +0200)
metze

pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm

index bd8d676c96ea8e902503eac29df4f22879d101d2..a4957bb5dec1948c8bc3f98bdc3a9676b571cc75 100644 (file)
@@ -1845,8 +1845,6 @@ sub ParseUnionPullPrimitives($$$$$)
 
                if ($el->{TYPE} ne "EMPTY") {
                        $self->indent;
-                       $self->DeclarePtrVariables($el);
-                       $self->DeclareArrayVariables($el);
                        if (defined($e->{PROPERTIES}{relative_base})) {
                                $self->pidl("NDR_CHECK(ndr_pull_align($ndr, $el->{ALIGN}));");
                                # set the current offset as base for relative pointers
@@ -1923,6 +1921,8 @@ sub ParseUnionPull($$$$)
                next if ($el->{TYPE} eq "EMPTY");
                next if ($double_cases{"$el->{NAME}"});
                $self->DeclareMemCtxVariables($el);
+               $self->DeclarePtrVariables($el);
+               $self->DeclareArrayVariables($el);
                $double_cases{"$el->{NAME}"} = 1;
        }