Code generated from IDL could generate more useful messages

Jelmer Vernooij jelmer at samba.org
Tue May 28 04:34:24 MDT 2013


On Mon, May 27, 2013 at 09:05:54PM -0700, Richard Sharpe wrote:
> I am not sure if this is fixed in master, but I noticed this in
> pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm:
> 
> sub ParseArrayPullGetSize($$$$$$)
> ...
>         $self->pidl("size_$e->{NAME}_$l->{LEVEL_INDEX} = $size;");
>         my $array_size = "size_$e->{NAME}_$l->{LEVEL_INDEX}";
> 
>         if (my $range = has_property($e, "range")) {
>                 my ($low, $high) = split(/,/, $range, 2);
> ...
>                 $self->pidl("\treturn ndr_pull_error($ndr,
> NDR_ERR_RANGE, \"value out of range\");");
> 
> It would be nice if this last had something like:
> 
>    \"value %u out of range $low..$high\",
> 
> Giving us more informative error messages is useful. It seems that the
> range property appears in lots of places, so it would be nice if there
> was more info on a failure to parse a field that had a range
> attribute.

Please file a bug about this against the pidl component in bugzilla.

Cheers,

Jelmer


More information about the samba-technical mailing list