r9298: pull non-array elements before array elements to overcome the problem
authorAndrew Tridgell <tridge@samba.org>
Sat, 13 Aug 2005 03:14:47 +0000 (03:14 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:33:22 +0000 (13:33 -0500)
of arrays that have length_is() or size_is() properties that refer to
later elements
(This used to be commit 9526f2a5104b50f4b6ab575cfa6270abb0377e51)

source4/build/pidl/Parse/Pidl/Samba/EJS.pm

index 415ca584b5967e44a868b9d3d027264c9e861813..1227e7aeb89357a41bd07c0f8b9607fa62fc2997 100644 (file)
@@ -374,8 +374,20 @@ sub EjsPullFunction($)
        indent;
        pidl "NDR_CHECK(ejs_pull_struct_start(ejs, &v, \"input\"));";
 
+       # we pull non-array elements before array elements as arrays
+       # may have length_is() or size_is() properties that depend
+       # on the non-array elements
        foreach my $e (@{$d->{ELEMENTS}}) {
                next unless (grep(/in/, @{$e->{DIRECTION}}));
+               next if (has_property($e, "length_is") || 
+                        has_property($e, "size_is"));
+               EjsPullElementTop($e, $env);
+       }
+
+       foreach my $e (@{$d->{ELEMENTS}}) {
+               next unless (grep(/in/, @{$e->{DIRECTION}}));
+               next unless (has_property($e, "length_is") || 
+                            has_property($e, "size_is"));
                EjsPullElementTop($e, $env);
        }