Commit cbd7f044 authored by Stefan Behnel's avatar Stefan Behnel

fix (or work-around?) for base class vtab type cast problem

parent 4d8e769a
......@@ -836,8 +836,11 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
#if need_self_cast:
# self.generate_self_cast(scope, code)
if type.vtabslot_cname:
if base_type:
struct_type_cast = "(struct %s*)" % base_type.vtabstruct_cname
vtab_base_type = type
while vtab_base_type.base_type and vtab_base_type.base_type.vtabstruct_cname:
vtab_base_type = vtab_base_type.base_type
if vtab_base_type is not type:
struct_type_cast = "(struct %s*)" % vtab_base_type.vtabstruct_cname
else:
struct_type_cast = ""
code.putln("p->%s = %s%s;" % (
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment