[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fwd: BOUNCE soot-list@sable.mcgill.ca: Non-member submission from [Robby <robby@cis.ksu.edu>]]
-------- Original Message --------
From: owner-soot-list@sable.mcgill.ca
Subject: BOUNCE soot-list@sable.mcgill.ca: Non-member submission from
[Robby <robby@cis.ksu.edu>]
To: owner-soot-list@sable.mcgill.ca
Hi,
I am trying to figure out why I have a null pointer exception throwed
from
ConstantAndCopyPropagator...
the code is as the following:
int i4, i5
A i1, h, i3
B i0
i0 := @this
i1 = new A
specialinvoke i1.[A.<init>():void]()
h = i1
i3 = h
i4 = virtualinvoke i0.[B.b(B):int](h)
i3.[A.id:int] = i4
i5 = i3.[A.id:int]
when I ran it through Transformations.cleanupCode... a null exception is
throwed in CopyAndConstantPropagator... the statements became:
int i4, i5
A i1, h, i3
B i0
i0 := @this
i1 = new A
specialinvoke i1.[A.<init>():void]()
h = i1
i3 = h
i4 = virtualinvoke i0.[B.b(B):int](i1)
i1.[A.id:int] = i4
i5 = i1.[A.id:int] // exception occured here... if (defsOfUse.size()
== 1)... raised that exception...
The localDefs.getDefsOfAt(<i1>, <i5 = i1.[A.id:int]>)
returned a null, because the map in the SimpleLocalDefs did not have an
entry with a key of (<i1>, <i5 = i1.[A.id:int]>), but it had an
entry with a key of (<i3>, <i5 = i1.[A.id:int]>) in it...
what I think is that the map of LocalDefs was outdated... using
useBox.setValue only updates a local usage in statements... but not as
part of the key (localStmtPairs) of LocalDefs' map... am I right?
-- robby