From: Arno P. <ar...@pu...> - 2011-09-20 12:09:12
|
On 9/20/11 4:12 AM, Shai wrote: > Do you have any tips for implementing the checks? > My general thought is to just create a macro next to the null check macro (with the option to switch it off/on) that performs a check against the array length and given offset. > Then just place that macro in the current XSLT code although I'm not exactly sure as to where? > I'm guessing here (and obviously for the other types too): > <xsl:when test="@type = 'byte'"><xsl:text>((java_lang_Byte*) argsArray[</xsl:text><xsl:value-of select="$index"/><xsl:text>])->fields.java_lang_Byte.value_</xsl:text></xsl:when> I just committed support for array bounds check. You need to compile your app with #define XMLVM_ENABLE_ARRAY_BOUNDS_CHECK to enable it. > While we are on the subject are there other things from the JVM spec that weren't implemented, off the top of my head I think we also depend on variables defaulting to 0/false especially in arrays. We do bzero arrays as well as initialize all variables. Can you send a specific example? >> No idea. What do you mean with "stop working"? It doesn't compile or the >> executable crashes? > > > Neither. The code just doesn't behave correctly and its hard for me to see the reason for the failure. I see a method call in the debugger and values effectively get garbled, math calculations produce the wrong result (which has quite a few implications in the code). I can investigate this further and let you know if I come up with something, I just hoped I wasn't the first to run into this. Sorry, but you are the first. :) Arno |