[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Jimple Type Assign error



I've poked around the type assigner a bit to see what's going on. The
problem seems to be that at the end of the type assigner, there's a
local called "tmp" whose type is null (not NullType, but null). The only
place that locals named "tmp" are created is in the insertCast methods
of ConstraintChecker. Indeed, on this example, the ConstraintChecker
creates a variable named tmp with a null type, as the result of a cast
of the l1 in the Jimple statement:

        if l1 >= 2 goto label1;

When this happens, l1 has a TypeNode with BooleanType, and 2 has the
TypeNode R0_127, whose type is null.

That is what seems to be happening. Can someone who knows about the type
assigner say which of it should not be happening? Should the tmp
variable with null type never be created? Should it somehow go away
before the type assigner finishes?

Ondrej

On Thu, Jul 08, 2004 at 01:34:32PM -0400, Jennifer Lhotak wrote:
> Hi,
> 
> The following java program :
> 
> public class JAssert {
> 
>     public static void main(String [] args){
>         int x = 0;
>         assert x == 0 : MyError.throwError("bug if error thrown");
>         assert x < 2 ? true : false : MyError.throwError("bug if error thrown");
> 
>     }
> }
> class MyError extends Error {
>     MyError(String s) { super(s); }
>     static boolean throwError(String s) {
>         throw new MyError(s);
>     }
> }
> 
> causes a Jimple TypeAssigner null pointer exception.
> 
> Does anyone know why this might be?
> 
> Thanks
> Jennifer
>