Hi madhatter,
On Tue, 8 Oct 2002, madhatter wrote:
> Hi, attached is a patch that does a divide by zero check, and if necessary throws an ArithmeticException on all division opcodes. It's also at http://www.alpha-beta.org/madhatter/aegisvm.div_ArithmeticException.diff if you want to get it there. Um, the code is directly in the inner loop of ae_interpret_bytecode, which might not be what you want, since it's the same code written twice for each data type (division and remainder ops), if you want me to implement it as a macro that's fine. I hope to do more with AegisVM, let me know.
Thank you for contributing. The code that fixes idiv/irem/ldiv/lrem
looks fine to me. I'll commit the diff today.
However, the code that throw exceptions on the floating
point cases is actually redundant. According to the JVM Spec, division
by zero should result in NaN in the floating point cases. The standard
semantics of C's floating point division already covers this.
Thanks again for contributing. There is still a lot of work to
be done on Aegis VM. Any further help is welcome.
Philip
--
Philip W. L. Fong pw...@us...
The Aegis VM Project http://aegisvm.sourceforge.net
The Aegis VM Project is an on-going effort to implement a lightweight,
secure JVM. It will eventually feature a modular architecture, Proof
Linking, that supports pluggable verification modules.
|