Menu

#226 NPE in escjava.translate.TrAnExpr.trSpecExprI

closed
ESC/Java2 (62)
5
2013-10-27
2004-05-18
No

The following code causes an NPE. The code calls a
helper method then throws a non-default exception in a
constructor.

class C
{
C() throws Exception {
helperMethod();
throw new Exception("E");
}

private /*@ helper @*/ void helperMethod() {
return;
}
}

Removing the helper annotation, or throwing using the
default constructor for Exception both cause the NPE to
disappear.

Discussion

  • David Cok

    David Cok - 2004-05-22
    • assigned_to: kiniry --> davidcok
     
  • David Cok

    David Cok - 2004-05-22

    Logged In: YES
    user_id=595682

    Fixed - helper methods are inlined, which caused a recursive
    call in a place where a needed pointer was reset - so it was
    null when it popped back up the call stack.

     
  • David Cok

    David Cok - 2004-05-22
    • status: open --> closed-fixed
     

Log in to post a comment.