fixed the handling of unions of pointers
authorAndrew Tridgell <tridge@samba.org>
Fri, 14 Nov 2003 07:19:32 +0000 (07:19 +0000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 14 Nov 2003 07:19:32 +0000 (07:19 +0000)
(This used to be commit 7b0f2ccf07fc4f097c2abb4e8e63a5d457383a11)

source4/build/pidl/parser.pm

index a3e10463d45f0324269f805e2d9a72b5a10e8ac9..6c09c3a924c044de3f1f866f70da61136864fdfe 100644 (file)
@@ -605,9 +605,13 @@ sub ParseUnionPull($)
        $res .= "\tNDR_CHECK(ndr_pull_uint16(ndr, level));\n";
        $res .= "\tswitch (*level) {\n";
        foreach my $el (@{$e->{DATA}}) {
-               $res .= "\tcase $el->{CASE}:\n";
+               $res .= "\tcase $el->{CASE}: {\n";
+               my $e2 = $el->{DATA};
+               if ($e2->{POINTERS}) {
+                       $res .= "\t\tuint32 _ptr_$e2->{NAME};\n";
+               }
                ParseElementPullScalar($el->{DATA}, "r->", "NDR_SCALARS");              
-               $res .= "\tbreak;\n\n";
+               $res .= "\tbreak; }\n\n";
        }
        $res .= "\tdefault:\n";
        $res .= "\t\treturn ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, \"Bad switch value \%u\", *level);\n";