Fixed some bugs and tried to maintain the bootstrap
This commit is contained in:
@@ -238,8 +238,6 @@ class AssignHandle(HandlesBase.Mixin):
|
||||
setitem_done = 1
|
||||
if setitem_done == 0:
|
||||
sub_vk: int = sub_asgn.value.kind()
|
||||
stdio.printf("[ASGN-SUB] fallback failed: val_kind=%d\n", sub_vk)
|
||||
stdio.fflush(0)
|
||||
if setitem_done == 0:
|
||||
HandlesType.fatal_error(target, "subscript ptr is None")
|
||||
continue
|
||||
@@ -249,25 +247,14 @@ class AssignHandle(HandlesBase.Mixin):
|
||||
field_ptr: llvmlite.Value | t.CPtr = HandlesExpr.get_attribute_ptr(
|
||||
builder, pool, mod, target, self.Trans)
|
||||
if field_ptr is not None:
|
||||
stdio.printf("[ASGN-ATTR] field_ptr ok ty_not_null=%d\n",
|
||||
1 if field_ptr.Ty is not None else 0)
|
||||
stdio.fflush(0)
|
||||
# 获取字段类型,对 rhs_val 进行类型转换(如 i32 → i64)
|
||||
store_val: llvmlite.Value | t.CPtr = rhs_val
|
||||
if field_ptr.Ty is not None:
|
||||
field_ty: llvmlite.LLVMType | t.CPtr = field_ptr.Ty.Pointee
|
||||
if field_ty is not None:
|
||||
stdio.printf("[ASGN-ATTR] coerce rhs_ty=%d field_ty=%d\n",
|
||||
HandlesExpr.get_llvm_type_bits(rhs_val.Ty),
|
||||
HandlesExpr.get_llvm_type_bits(field_ty))
|
||||
stdio.fflush(0)
|
||||
store_val = HandlesExpr.coerce_to_type(
|
||||
builder, rhs_val, field_ty)
|
||||
stdio.printf("[ASGN-ATTR] pre_store\n")
|
||||
stdio.fflush(0)
|
||||
llvmlite.build_store(builder, store_val, field_ptr)
|
||||
stdio.printf("[ASGN-ATTR] post_store\n")
|
||||
stdio.fflush(0)
|
||||
else:
|
||||
# 构造详细错误信息
|
||||
attr_node: ast.Attribute | t.CPtr = (ast.Attribute | t.CPtr)(target)
|
||||
|
||||
Reference in New Issue
Block a user