From 06942f3ddbb897c66644c253d1d2a7a21a31702e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 26 Nov 2003 01:13:00 +0000 Subject: added some paranoid checking for enums (This used to be commit 3492f37b0bf14797514f1dc603f518bf5b801c3c) --- source4/build/pidl/header.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source4/build') diff --git a/source4/build/pidl/header.pm b/source4/build/pidl/header.pm index 5a75e4c9b4..c71b8fbeb1 100644 --- a/source4/build/pidl/header.pm +++ b/source4/build/pidl/header.pm @@ -57,7 +57,8 @@ sub HeaderElement($) } } if (defined $element->{ARRAY_LEN} && - !util::is_constant($element->{ARRAY_LEN})) { + !util::is_constant($element->{ARRAY_LEN}) && + !$element->{POINTERS}) { # conformant arrays are ugly! I choose to implement them with # pointers instead of the [1] method $res .= "*"; @@ -105,7 +106,9 @@ sub HeaderEnum($$) my $e = ${$els}[$#{$els}]; tabs(); chomp $e; - $e =~ /^(.*?)\s*$/; + if ($e !~ /^(.*?)\s*$/) { + die "Bad enum $name\n"; + } $res .= "$1\n"; $tab_depth--; $res .= "}"; -- cgit