From 791459f61b2487c6f233a1d32695a805627d86dc Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 29 Dec 2008 21:07:11 +0100 Subject: pidl: don't generate invalid C code When we don't know how to handle a type for the python bindings, we should not generate invalid C code. Jelmer: please fix do the full fix for this. metze --- pidl/lib/Parse/Pidl/Samba4/Python.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pidl/lib/Parse/Pidl/Samba4/Python.pm') diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index 68e9c95395..2474bf41a8 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -789,7 +789,9 @@ sub register_module_object($$$) sub assign($$$) { my ($self, $dest, $src) = @_; - if ($dest =~ /^\&/) { + if ($dest =~ /^\&/ and $src eq "NULL") { + $self->pidl("memset($dest, 0, sizeof(" . get_value_of($dest) . "));"); + } elsif ($dest =~ /^\&/) { $self->pidl("memcpy($dest, $src, sizeof(" . get_value_of($dest) . "));"); } else { $self->pidl("$dest = $src;"); -- cgit