diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-04-15 14:32:13 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-04-15 14:32:13 +0200 |
commit | fd52fe86169ddc0adda2d1cd97215c58d06f93c4 (patch) | |
tree | 5c63ae7cac614f63ff1f35598ff31ca903d2e509 /source4/pidl/lib/Parse | |
parent | 983b66b8f16ba4e06a8b239e5c4191e3f0245481 (diff) | |
download | samba-fd52fe86169ddc0adda2d1cd97215c58d06f93c4.tar.gz samba-fd52fe86169ddc0adda2d1cd97215c58d06f93c4.tar.bz2 samba-fd52fe86169ddc0adda2d1cd97215c58d06f93c4.zip |
Fix pointers when pushing strings to python during pidl generation.
(This used to be commit ca72187b3e71a037780d42a57e46b60e75f724f6)
Diffstat (limited to 'source4/pidl/lib/Parse')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba4/Python.pm | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm index acaea99f6d..2d12da358c 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -952,16 +952,15 @@ sub ConvertObjectToPythonLevel($$$$$) $self->pidl("}"); } } elsif ($l->{TYPE} eq "ARRAY") { - if (is_charset_array($e, $l)) { + my $pl = GetPrevLevel($e, $l); + if ($pl && $pl->{TYPE} eq "POINTER") { $var_name = get_pointer_to($var_name); + } + + if (is_charset_array($e, $l)) { # FIXME: Use Unix charset setting rather than utf-8 $self->pidl("$py_var = PyUnicode_Decode($var_name, strlen($var_name), \"utf-8\", \"ignore\");"); } else { - my $pl = GetPrevLevel($e, $l); - if ($pl && $pl->{TYPE} eq "POINTER") { - $var_name = get_pointer_to($var_name); - } - die("No SIZE_IS for array $var_name") unless (defined($l->{SIZE_IS})); my $length = $l->{SIZE_IS}; if (defined($l->{LENGTH_IS})) { |