提交 225e3491 编写于 作者: F Fadi Hanna

Pass zero length array as null

Turns out zero length arrays are passed as a pointer to the non-existing element only when the array is passed by reference.
上级 932883ad
......@@ -1435,6 +1435,11 @@ protected override void AllocAndTransformManagedToNative(ILCodeStream codeStream
{
ILLocalVariable vPinnedFirstElement = emitter.NewLocal(ManagedElementType.MakeByRefType(), true);
LoadManagedValue(codeStream);
codeStream.Emit(ILOpcode.ldlen);
codeStream.Emit(ILOpcode.conv_i4);
codeStream.Emit(ILOpcode.brfalse, lNullArray);
LoadManagedValue(codeStream);
codeStream.Emit(ILOpcode.call, emitter.NewToken(getRawSzArrayDataMethod));
codeStream.EmitStLoc(vPinnedFirstElement);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册