summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-05-07 17:26:40 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-09-15 17:36:58 +0200
commit15ebda7e1b18cc29be891b1370473c8bc3acc2c6 (patch)
tree9a61d8ae9186f9428a929d51c3f94704a58975bf /source4/pidl/lib/Parse/Pidl
parent7b88d09d8dbb1a31e4266a39e2ff5e93dcc529c0 (diff)
downloadsamba-15ebda7e1b18cc29be891b1370473c8bc3acc2c6.tar.gz
samba-15ebda7e1b18cc29be891b1370473c8bc3acc2c6.tar.bz2
samba-15ebda7e1b18cc29be891b1370473c8bc3acc2c6.zip
Deal with interface in generated python code, clearer error message on unhandled unions.
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl')
-rw-r--r--source4/pidl/lib/Parse/Pidl/NDR.pm1
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/Python.pm3
2 files changed, 4 insertions, 0 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/NDR.pm b/source4/pidl/lib/Parse/Pidl/NDR.pm
index 10bd29715b..a34e7ef7ba 100644
--- a/source4/pidl/lib/Parse/Pidl/NDR.pm
+++ b/source4/pidl/lib/Parse/Pidl/NDR.pm
@@ -876,6 +876,7 @@ my %property_list = (
"unique" => ["ELEMENT"],
"ignore" => ["ELEMENT"],
"relative" => ["ELEMENT"],
+ "null_is_ffffffff" => ["ELEMENT"],
"relative_base" => ["TYPEDEF", "STRUCT", "UNION"],
"gensize" => ["TYPEDEF", "STRUCT", "UNION"],
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
index ab67236717..b7d092015c 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -1025,6 +1025,9 @@ sub ConvertObjectToPythonData($$$$$)
return $self->ConvertScalarToPython(Parse::Pidl::Typelist::bitmap_type_fn($actual_ctype), $cvar);
} elsif ($actual_ctype->{TYPE} eq "SCALAR") {
return $self->ConvertScalarToPython($actual_ctype->{NAME}, $cvar);
+ } elsif ($actual_ctype->{TYPE} eq "UNION") {
+ # FIXME: Should be fatal() rather than die()
+ die("union without discriminant: " . mapTypeName($ctype) . ": $cvar");
} elsif ($actual_ctype->{TYPE} eq "STRUCT" or $actual_ctype->{TYPE} eq "INTERFACE") {
return "py_talloc_import_ex(&$ctype->{NAME}_Type, $mem_ctx, $cvar)";
}