summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl
diff options
context:
space:
mode:
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl')
-rw-r--r--source4/pidl/lib/Parse/Pidl/NDR.pm14
1 files changed, 9 insertions, 5 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/NDR.pm b/source4/pidl/lib/Parse/Pidl/NDR.pm
index f274836fe7..114de797b8 100644
--- a/source4/pidl/lib/Parse/Pidl/NDR.pm
+++ b/source4/pidl/lib/Parse/Pidl/NDR.pm
@@ -109,6 +109,15 @@ sub GetElementLevelTable($)
@bracket_array = @{$e->{ARRAY_LEN}};
}
+ if (has_property($e, "out")) {
+ my $needptrs = 1;
+
+ if (has_property($e, "string")) { $needptrs++; }
+ if ($#bracket_array >= 0) { $needptrs = 0; }
+
+ nonfatal($e, "[out] argument `$e->{NAME}' not a pointer") if ($needptrs > $e->{POINTERS});
+ }
+
# Parse the [][][][] style array stuff
for my $i (0 .. $#bracket_array) {
my $d = $bracket_array[$#bracket_array - $i];
@@ -543,11 +552,6 @@ sub ParseFunction($$$)
push (@{$e->{DIRECTION}}, "in") if (has_property($x, "in"));
push (@{$e->{DIRECTION}}, "out") if (has_property($x, "out"));
- nonfatal($x, "`$e->{NAME}' is [out] argument but not a pointer or array")
- if ($e->{LEVELS}[0]->{TYPE} ne "POINTER" and
- $e->{LEVELS}[0]->{TYPE} ne "ARRAY" and
- grep(/out/, @{$e->{DIRECTION}}));
-
push (@elements, $e);
}