diff options
author | Stefan Metzmacher <metze@samba.org> | 2008-12-29 21:07:11 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2008-12-29 23:23:27 +0100 |
commit | 791459f61b2487c6f233a1d32695a805627d86dc (patch) | |
tree | 40932e774201c6d4916c98e311d5a1f2e922b4d0 /pidl | |
parent | 7516ba860c160e8b971b6f5bc1036370169e6e8a (diff) | |
download | samba-791459f61b2487c6f233a1d32695a805627d86dc.tar.gz samba-791459f61b2487c6f233a1d32695a805627d86dc.tar.bz2 samba-791459f61b2487c6f233a1d32695a805627d86dc.zip |
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
Diffstat (limited to 'pidl')
-rw-r--r-- | pidl/lib/Parse/Pidl/Samba4/Python.pm | 4 |
1 files changed, 3 insertions, 1 deletions
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;"); |