Signed-off-by: Tomek Grabiec <tgrab...@gmail.com> --- jit/exception-bc.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/jit/exception-bc.c b/jit/exception-bc.c index cf51274..46760b5 100644 --- a/jit/exception-bc.c +++ b/jit/exception-bc.c @@ -38,6 +38,7 @@ int convert_athrow(struct parse_context *ctx) { struct stack *mimic_stack = ctx->bb->mimic_stack; struct expression *exception_ref; + struct expression *nullcheck; struct statement *stmt; stmt = alloc_statement(STMT_ATHROW); @@ -45,7 +46,12 @@ int convert_athrow(struct parse_context *ctx) return -ENOMEM; exception_ref = stack_pop(mimic_stack); - stmt->exception_ref = &exception_ref->node; + + nullcheck = null_check_expr(exception_ref); + if (!nullcheck) + return -ENOMEM; + + stmt->exception_ref = &nullcheck->node; /* * According to the JVM specification athrow operation is -- 1.6.0.6 ------------------------------------------------------------------------------ Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com _______________________________________________ Jatovm-devel mailing list Jatovm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jatovm-devel