!23 Parse a field's "enum=" correctly
From: @zhang-liang-pengkun Reviewed-by: @Charlie_li Signed-off-by: @Charlie_li
This commit is contained in:
commit
db113dae87
49
0001-Parse-a-field-s-enum-correctly.patch
Normal file
49
0001-Parse-a-field-s-enum-correctly.patch
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
From 2b3559c10c18eb63e61efdc8a030765d624a0fba Mon Sep 17 00:00:00 2001
|
||||||
|
From: Uli Schlachter <psychon@znc.in>
|
||||||
|
Date: Sat, 21 Mar 2020 11:12:52 +0100
|
||||||
|
Subject: [PATCH] Parse a field's "enum=" correctly
|
||||||
|
|
||||||
|
In xv.xml, there is something like this:
|
||||||
|
|
||||||
|
<struct name="ImageFormatInfo">
|
||||||
|
[...]
|
||||||
|
<field type="CARD8" name="byte_order" enum="ImageOrder" />
|
||||||
|
<pad bytes="2" />
|
||||||
|
<list type="CARD8" name="guid">
|
||||||
|
<value>16</value>
|
||||||
|
</list>
|
||||||
|
[...]
|
||||||
|
</struct>
|
||||||
|
|
||||||
|
When parsing this, the Field instance for "guid" ended up with .enum ==
|
||||||
|
"ImageOrder". This is because the loop that parses complex type did not
|
||||||
|
unset a variable across iterations, meaning that the last "enum"
|
||||||
|
property "stuck" and was also used for all following fields.
|
||||||
|
|
||||||
|
Fix this by simply moving the initialisation of the "enum" variable
|
||||||
|
inside of the loop.
|
||||||
|
|
||||||
|
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
||||||
|
---
|
||||||
|
xcbgen/xtypes.py | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/xcbgen/xtypes.py b/xcbgen/xtypes.py
|
||||||
|
index 3afc812..e47189d 100644
|
||||||
|
--- a/xcbgen/xtypes.py
|
||||||
|
+++ b/xcbgen/xtypes.py
|
||||||
|
@@ -528,10 +528,10 @@ class ComplexType(Type):
|
||||||
|
def resolve(self, module):
|
||||||
|
if self.resolved:
|
||||||
|
return
|
||||||
|
- enum = None
|
||||||
|
|
||||||
|
# Resolve all of our field datatypes.
|
||||||
|
for child in list(self.elt):
|
||||||
|
+ enum = None
|
||||||
|
if child.tag == 'pad':
|
||||||
|
field_name = 'pad' + str(module.pads)
|
||||||
|
fkey = 'CARD8'
|
||||||
|
--
|
||||||
|
2.39.0.windows.2
|
||||||
|
|
||||||
@ -1,11 +1,12 @@
|
|||||||
%define debug_package %{nil}
|
%define debug_package %{nil}
|
||||||
Name: xcb-proto
|
Name: xcb-proto
|
||||||
Version: 1.14
|
Version: 1.14
|
||||||
Release: 2
|
Release: 3
|
||||||
Summary: XCB protocol descriptions
|
Summary: XCB protocol descriptions
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://gitlab.freedesktop.org/xorg/proto/xcbproto/
|
URL: https://gitlab.freedesktop.org/xorg/proto/xcbproto/
|
||||||
Source0: https://xcb.freedesktop.org/dist/%{name}-%{version}.tar.gz
|
Source0: https://xcb.freedesktop.org/dist/%{name}-%{version}.tar.gz
|
||||||
|
Patch01: 0001-Parse-a-field-s-enum-correctly.patch
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
BuildRequires: python3-devel
|
BuildRequires: python3-devel
|
||||||
@ -36,6 +37,9 @@ export PYTHON="python3"
|
|||||||
%{python3_sitelib}/xcbgen
|
%{python3_sitelib}/xcbgen
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Oct 12 2023 zhangliangpengkun <zhangliangpengkun@xfusion.com> - 1.14-3
|
||||||
|
- Parse a field's "enum=" correctly
|
||||||
|
|
||||||
* Fri Jan 6 2023 yangbo <yangbo1@xfusion.com> - 1.14-2
|
* Fri Jan 6 2023 yangbo <yangbo1@xfusion.com> - 1.14-2
|
||||||
- Type:bugfix
|
- Type:bugfix
|
||||||
- CVE:NA
|
- CVE:NA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user