From d9862f2bc48e4da63aaa4cc0255d08fd36bd0a66 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 4 Nov 2006 02:51:03 +0000 Subject: r19546: fix number of bytes pushed when using switch_type() set to enum types. die() on invalid used of enum_type_fn() (This used to be commit de6198c893737e63a5ff70684c1df212da054988) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 2 +- source4/pidl/lib/Parse/Pidl/Typelist.pm | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'source4') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 75f30f7370..1bb277fd0e 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -1694,7 +1694,7 @@ sub ParseUnionPull($$) pidl "int level;"; if (defined($switch_type)) { if (Parse::Pidl::Typelist::typeIs($switch_type, "ENUM")) { - $switch_type = Parse::Pidl::Typelist::enum_type_fn(getType($switch_type)); + $switch_type = Parse::Pidl::Typelist::enum_type_fn(getType($switch_type)->{DATA}); } pidl mapType($switch_type) . " _level;"; } diff --git a/source4/pidl/lib/Parse/Pidl/Typelist.pm b/source4/pidl/lib/Parse/Pidl/Typelist.pm index 66d5e59e7c..4109e8032e 100644 --- a/source4/pidl/lib/Parse/Pidl/Typelist.pm +++ b/source4/pidl/lib/Parse/Pidl/Typelist.pm @@ -153,6 +153,7 @@ sub RegisterScalars() sub enum_type_fn($) { my $enum = shift; + $enum->{TYPE} eq "ENUM" or die("not an enum"); if (has_property($enum->{PARENT}, "enum8bit")) { return "uint8"; } elsif (has_property($enum->{PARENT}, "v1_enum")) { -- cgit