Files
TransPyC/Test/G7/includes/conflict_node.py

31 lines
906 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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