X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=xcbgen%2Fexpr.py;h=274c29089b0be51e7b43535346221e6567904e11;hb=dd227908abdb36ba630ac9d8a5449470721e38b8;hp=ddfb76c00d0bf09e5911206ea5798a127ca0ff04;hpb=d30664b58016687379d42d18056827fe57830d20;p=free-sw%2Fxcb%2Fproto diff --git a/xcbgen/expr.py b/xcbgen/expr.py index ddfb76c..274c290 100644 --- a/xcbgen/expr.py +++ b/xcbgen/expr.py @@ -117,7 +117,11 @@ class Expression(object): for p in reversed(parents): fields = dict([(f.field_name, f) for f in p.fields]) if self.lenfield_name in fields.keys(): - self.lenfield_parent = p + if p.is_bitcase: + # switch is the anchestor + self.lenfield_parent = p.parents[-1] + else: + self.lenfield_parent = p self.lenfield_type = fields[self.lenfield_name].field_type break