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

Re: Precision of Spark Analysis



Sorry, but Spark does not have a combination of switches that would
do what you're asking for. I don't see an easy way of implementing
it, either, because it would require tighter interaction between the
points-to analysis and the call graph. Still, I think it's something
that would be useful, so I'll keep it in mind as something to add at
some point.

Ondrej

On Tue, Dec 16, 2003 at 02:44:41PM +0100, buckley wrote:
> Hi,
> 
> I've got a question about the precision of SPARK's points-to analysis.
> In my small example below I calculated the points-to sets with the
> standard options.
> The sets always include that "A.f()" points to "c" which is not possible
> I think.
> What I want know is, whether it is possible to enhance SPARK's precision
> 
> (by some combination of switches maybe) so that it is able to handle
> this kind of
> problem.
> 
> Greetings,
>      Thorsten Buckley
> 
> ----------------------------------------------
> public class A {
>  public int f() { return(g()); }
>  public int g() { return(x); }
>  public int x;
> }
> 
> public class B extends A {
>  public int g() { return(y); }
>  public int y;
> }
> 
> public class C extends B {
>  public C() {}
>  public int f() { return( g() + z ); }
>  public int z;
> }
> 
> 
> public class Test {
>  public static void main(String[] args) {
>   A a = new A(); B b = new B(); C c = new C();
>   A ap;
>   if(args.length == 0) { ap = a; }
>   else { if(args.length == 1) { ap = b; }
>      else { ap = c; } }
>   ap.f();
>  }
> }
>