Very clever! It seems like an array bounds check is converted into an unsigned comparison followed by a JNB on Ia32. This single compare-and-branch sequence correctly implements both the upper bound and lower bound checks. Because the comparison is unsigned, a negative index will look like a very large positive index and will fail the check.

Naveen

On Sep 20, 2006, at 4:06 PM, Naveen Neelakantam wrote:

Hello,

It seems that the Op_TauCheckBounds opcode in the HIR is converted into an upper bounds check during HIR->LIR conversion (see CodeGenerator.cpp and Ia32InstCodeSelector.cpp). It does not seem that the corresponding lower bounds check is ever generated.

Am I misunderstanding the code somehow? It doesn't seem correct to me.

Thanks,
Naveen

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to