From 33255102acd755cacceafd2a082722ed0fbc695f Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Sun, 1 Dec 2019 00:41:42 +1300 Subject: [PATCH] pidl Parse::Pidl::NDR: warn of unknown scalar alignments Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- pidl/lib/Parse/Pidl/NDR.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pidl/lib/Parse/Pidl/NDR.pm b/pidl/lib/Parse/Pidl/NDR.pm index dec5e954230..f48b0f8bb12 100644 --- a/pidl/lib/Parse/Pidl/NDR.pm +++ b/pidl/lib/Parse/Pidl/NDR.pm @@ -469,7 +469,12 @@ sub align_type($) my ($e) = @_; if (ref($e) eq "HASH" and $e->{TYPE} eq "SCALAR") { - return $scalar_alignment->{$e->{NAME}}; + my $ret = $scalar_alignment->{$e->{NAME}}; + if (not defined $ret) { + warning($e, "no scalar alignment for $e->{NAME}!"); + return 0; + } + return $ret; } return 0 if ($e eq "EMPTY");