mirror of
https://gitlab.freedesktop.org/xorg/lib/libxcb.git
synced 2026-05-08 19:28:08 +02:00
c_client.py: use last field to get past the end of struct reply members
Part-of: <https://gitlab.freedesktop.org/xorg/lib/libxcb/-/merge_requests/74>
This commit is contained in:
parent
bfa06609c3
commit
d8130b5a56
1 changed files with 9 additions and 1 deletions
10
src/c_client.py
Normal file → Executable file
10
src/c_client.py
Normal file → Executable file
|
|
@ -1920,7 +1920,15 @@ def _c_accessors_list(self, field):
|
|||
if switch_obj is not None:
|
||||
_c(' return %s;', fields[field.c_field_name][0])
|
||||
elif field.prev_varsized_field is None:
|
||||
_c(' return (%s *) (R + 1);', field.c_field_type)
|
||||
prev_field = None
|
||||
for f in R_obj.fields:
|
||||
if f == field:
|
||||
break
|
||||
prev_field = f
|
||||
if R_obj.is_reply:
|
||||
_c(' return (%s *) (&R->%s + %d);', field.c_field_type, prev_field.c_field_name, prev_field.type.nmemb)
|
||||
else:
|
||||
_c(' return (%s *) (R + 1);', field.c_field_type)
|
||||
else:
|
||||
(prev_varsized_field, align_pad) = get_align_pad(field)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue