import t from linkedlist import GSListNode # ============================================================ # 最小化复现:类名 'Value' 与全局变量名冲突 # # 这个类在 includes 目录中(走 Phase1 路径),生成 stub.ll # 继承 GSListNode[Value] 获取 Next 字段 # 5 个自有字段 + 1 个继承字段(Next) = 6 字段 # # 若 _get_or_create_struct('Value') 因 SymbolTable 中 # IsVariable=True 而返回 _TypedPointerType, # 则 set_body 被跳过,struct 保持不完整 → GEP 越界崩溃 # ============================================================ @t.NoVTable class Value(GSListNode[Value]): Ty: t.CPtr Name: t.CPtr IsConst: t.CInt IntVal: t.CInt64T FloatVal: t.CDouble def __init__(self): self.Ty = None self.Name = None self.IsConst = 0 self.IntVal = 0 self.FloatVal = 0.0 self.Next = None