Skip to content

Conversation

@Siuming93
Copy link
Contributor

当一个做了值类型绑定的结构体赋值给一个object对象,并对一个新的object对象进行赋值时,会抛出NotImplementedException异常.

{
var ct = domain.GetTypeByIndex(dst->Value) as CLRType;
var binder = ct.ValueTypeBinder;
v->ObjectType = ObjectTypes.ValueTypeObjectReference;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

将值类型绑定的对象往object存的语义是将该对象装箱,因此正确的做法应该是调用StackObject.ToObject(esp)拿到object, 再存入mStack[v->Value]中,然后FreeStackValueType(esp);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants