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 14:26:01 +0000 (16:26 +0200)
metze

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

index 8ab2967ea5ad58d647553ecfc2cfac41bd24b46f..ccf9af97f35707ef1ed768106451593838aedc85 100644 (file)
@@ -1833,8 +1833,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
@@ -1911,6 +1909,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;
        }