Skip to content

Commit d376487

Browse files
douglas-raillard-arminducer
authored andcommitted
Fix TypeDecl -> TypeDeclExt conversion
pycparser's TypeDecl node gained an "align" __init__ parameter, so forward it and use named parameters to avoid silent breakage in the future. The issue manifested as a Coord object being used for "type".
1 parent 6b9db4a commit d376487

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

pycparserext/ext_c_parser.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,14 @@ class TypeDeclExt(c_ast.TypeDecl):
189189
@staticmethod
190190
def from_pycparser(td):
191191
assert isinstance(td, c_ast.TypeDecl)
192-
return TypeDeclExt(td.declname, td.quals, td.type, td.coord)
192+
193+
return TypeDeclExt(
194+
declname=td.declname,
195+
quals=td.quals,
196+
align=td.align,
197+
type=td.type,
198+
coord=td.coord
199+
)
193200

194201

195202
class ArrayDeclExt(c_ast.ArrayDecl):

0 commit comments

Comments
 (0)