diff options
author | Alexander Larsson <alexl@redhat.com> | 2010-07-01 16:45:04 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2012-03-20 15:25:46 +0100 |
commit | 8ec1247dbe40ca7d0678e95c45f0d3a7b8908b77 (patch) | |
tree | fca5f21e65bc31d6d040846a1dba4e29a8eec022 /python_modules/demarshal.py | |
parent | 6d38c4817f751f5f47dd1d22ba8319675bb57295 (diff) | |
download | spice-protocol-8ec1247dbe40ca7d0678e95c45f0d3a7b8908b77.tar.gz spice-protocol-8ec1247dbe40ca7d0678e95c45f0d3a7b8908b77.tar.xz spice-protocol-8ec1247dbe40ca7d0678e95c45f0d3a7b8908b77.zip |
Fix 32bit failure in demarshaller
Due to a typo we always read offsets as pointers, never as SPICE_ADDRESS.
Diffstat (limited to 'python_modules/demarshal.py')
-rw-r--r-- | python_modules/demarshal.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/python_modules/demarshal.py b/python_modules/demarshal.py index b819513..023c3f6 100644 --- a/python_modules/demarshal.py +++ b/python_modules/demarshal.py @@ -837,14 +837,14 @@ def write_ptr_info_check(writer): is_ptr = "ptr_info[%s].is_ptr" % index dest = "ptr_info[%s].dest" % index with writer.if_block("%s == 0" % offset, newline=False): - with writer.if_block("%s == 0" % is_ptr, newline=False): + with writer.if_block(is_ptr, newline=False): writer.assign("*(void **)(%s)" % dest, "NULL") with writer.block(" else"): writer.assign("*(SPICE_ADDRESS *)(%s)" % dest, "0") with writer.block(" else"): writer.comment("Align to 32 bit").newline() writer.assign("end", "(uint8_t *)SPICE_ALIGN((size_t)end, 4)") - with writer.if_block("%s == 0" % is_ptr, newline=False): + with writer.if_block(is_ptr, newline=False): writer.assign("*(void **)(%s)" % dest, "(void *)end") with writer.block(" else"): writer.assign("*(SPICE_ADDRESS *)(%s)" % dest, "(SPICE_ADDRESS)end") |