[Mono-devel-list] Re: Abcremoval

Jonathan Gilbert 2a5gjx302 at sneakemail.com
Tue Feb 1 12:02:49 EST 2005


At 04:23 PM 01/02/2005 +0100, Willibald Krenn wrote:
>No, AFAICT the index is treated as unsigned int32 (minus MSB):
>shl    %eax	/* multiply by 2; clears top 32 bits on AMD64 IIRC;*/
>/*no signed widening here*/
>add    %rcx,%rax /*rcx is pointer to string; rax is index by two */
>movzwq 0x14(%rax),%r14 /*copy*/
>
>IOW: There is no such thing as a negative index for string access.

This will cause bad behaviour if the user does "my_string[-1]" for a
typical (much shorter than 4 gigabytes) string...

Jonathan Gilbert



More information about the Mono-devel-list mailing list