diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2006-11-04 02:51:03 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:24:48 -0500 |
commit | d9862f2bc48e4da63aaa4cc0255d08fd36bd0a66 (patch) | |
tree | 076a794bedd5e32a81bea766db562c5ab6e4bd93 /source4 | |
parent | 36b971bb3c77894bca4f83901f8c673f14480b0b (diff) | |
download | samba-d9862f2bc48e4da63aaa4cc0255d08fd36bd0a66.tar.gz samba-d9862f2bc48e4da63aaa4cc0255d08fd36bd0a66.tar.bz2 samba-d9862f2bc48e4da63aaa4cc0255d08fd36bd0a66.zip |
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)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 2 | ||||
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Typelist.pm | 1 |
2 files changed, 2 insertions, 1 deletions
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")) { |