[Mono-dev] Big Arrays, Many Changes --- Request for Advice

Luis F. Ortiz LuisOrtiz at Verizon.Net
Tue Sep 4 19:32:10 EDT 2007


On Sep 4, 2007, at 6:51 AM, Marek Safar wrote:
> Hi Luis,
>> 1)  MCS assumed that the arguments to NEWARR were always U4 or I4,
>> which does not seem
>>      to be the case as far as ECMA-335v4.
>> ...
>> A)  Fix mcs/expression.cs to emit OpCodes.Conv_Ovf_U/I instead of
>> OpCodes.Conv_Ovf_U4/I4
>>      for array size arguments,
> Any mcs patches with self contained tests are welcome. However,
> I think I fix this issue 2-3 weeks ago. Please use SVN version  
> instead.

I see you did do serious surgery to the code in question in revision  
84357.
I have a question: ¿How literally should ECMA-335 be taken?
If one were to take section 4.20 (newarr – create a zero-based, one- 
dimensional array)
literally:

     Valid array indexes are 0 <= index < numElems. ...
     Verifiability:  .numElems shall be of type native int or int32.

then I would be inclined to say some work might still be necessary.
The implication would be that unsigned arguments are not proper and that
a 32 bit implementation should be limited to 2^32 - 1 elements.

So perhaps uint32_type's should be converted via Conv_Ovf_I4,
and uint64_type's via Conv_Ovf_I.

But at least now there is only one method to change, though I suspect  
it will take
more than a few minutes for me to get the SVN version to compile from  
scratch.

--Luis F. Ortiz

-------------- next part --------------
A non-text attachment was scrubbed...
Name: EmitArray.diff
Type: application/octet-stream
Size: 606 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070904/5737011f/attachment.obj 


More information about the Mono-devel-list mailing list