From: Jelmer Vernooij Date: Tue, 16 Dec 2008 17:02:14 +0000 (+0100) Subject: Make some fatal errors non-fatal. This means we generate invalid code in X-Git-Tag: samba-4.0.0alpha6~473^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9692c71aa1552a6415bec185706aa7afdf16c288;p=thirdparty%2Fsamba.git Make some fatal errors non-fatal. This means we generate invalid code in some cases, but we do print errors. We don't use all generated code yet at the moment, so this isn't much of a problem. --- diff --git a/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm b/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm index 4109ce99621..9a7a037b544 100644 --- a/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm +++ b/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm @@ -12,7 +12,7 @@ use Exporter; @EXPORT_OK = qw(ParseFunction $res $res_hdr ParseOutputArgument); use strict; -use Parse::Pidl qw(fatal warning); +use Parse::Pidl qw(fatal warning error); use Parse::Pidl::Util qw(has_property ParseExpr); use Parse::Pidl::Samba4 qw(DeclLong); use Parse::Pidl::Samba4::Header qw(GenerateFunctionInEnv); @@ -76,7 +76,11 @@ sub ParseOutputArgument($$$) my ($self, $fn, $e) = @_; my $level = 0; - fatal($e->{ORIGINAL}, "[out] argument is not a pointer or array") if ($e->{LEVELS}[0]->{TYPE} ne "POINTER" and $e->{LEVELS}[0]->{TYPE} ne "ARRAY"); + if ($e->{LEVELS}[0]->{TYPE} ne "POINTER" and $e->{LEVELS}[0]->{TYPE} ne "ARRAY") { + $self->pidl("return NT_STATUS_NOT_SUPPORTED;"); + error($e->{ORIGINAL}, "[out] argument is not a pointer or array"); + return; + } if ($e->{LEVELS}[0]->{TYPE} eq "POINTER") { $level = 1; diff --git a/pidl/lib/Parse/Pidl/Samba4.pm b/pidl/lib/Parse/Pidl/Samba4.pm index 5bdb91ee251..20c518dcebf 100644 --- a/pidl/lib/Parse/Pidl/Samba4.pm +++ b/pidl/lib/Parse/Pidl/Samba4.pm @@ -12,7 +12,7 @@ require Exporter; use Parse::Pidl::Util qw(has_property is_constant); use Parse::Pidl::NDR qw(GetNextLevel); use Parse::Pidl::Typelist qw(mapTypeName scalar_is_reference); -use Parse::Pidl qw(fatal); +use Parse::Pidl qw(fatal error); use strict; use vars qw($VERSION); @@ -69,7 +69,7 @@ sub NumStars($;$) $n++; } - fatal($e->{ORIGINAL}, "Too few pointers $n < $d") if ($n < $d); + error($e->{ORIGINAL}, "Too few pointers $n < $d") if ($n < $d); $n -= $d;