From ce0c2236b953dc977655dbceef40916825e843ae Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 21 Nov 2006 23:21:08 +0000 Subject: r19830: Warn about non-ref top-level pointers. (This used to be commit 78153200ac45ce7333c91c48ded549b5eed5e077) --- source4/pidl/lib/Parse/Pidl/NDR.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source4') diff --git a/source4/pidl/lib/Parse/Pidl/NDR.pm b/source4/pidl/lib/Parse/Pidl/NDR.pm index a80bb954c1..d017c455a6 100644 --- a/source4/pidl/lib/Parse/Pidl/NDR.pm +++ b/source4/pidl/lib/Parse/Pidl/NDR.pm @@ -70,8 +70,6 @@ my $scalar_alignment = { 'ipv4address' => 4 }; - - sub nonfatal($$) { my ($e,$s) = @_; @@ -135,8 +133,7 @@ sub GetElementLevelTable($) $is_string = 1; delete($e->{PROPERTIES}->{string}); } else { - print "$e->{FILE}:$e->{LINE}: Must specify size_is() for conformant array!\n"; - exit 1; + fatal($e, "Must specify size_is() for conformant array!") } if (($length = shift @length_is) or $is_string) { @@ -184,6 +181,10 @@ sub GetElementLevelTable($) LEVEL => $level }); + nonfatal($e, "top-level pointer `$e->{NAME}' is not a \[ref\] pointer") + if ($i == 1 and pointer_type($e) ne "ref" and + $e->{PARENT}->{TYPE} eq "FUNCTION"); + $pointer_idx++; # everything that follows will be deferred -- cgit