Sheet 4 Ex. 1a)

Moderator: Implementing code analyses for large software systems

Vespertine
Erstie
Erstie
Beiträge: 16
Registriert: 8. Okt 2013 22:43

Sheet 4 Ex. 1a)

Beitrag von Vespertine »

Hello,

TargetClass1 contains the following jimple code:

Code: Alles auswählen

        $r0 = new de.ecspride.sse.ica.ex1.analyzeMe.TargetClass1$Pythagoras;
        specialinvoke $r0.<de.ecspride.sse.ica.ex1.analyzeMe.TargetClass1$Pythagoras: void <init>(int,int,int)>(3, 4, 5);
        pythagoras = $r0;
1. I assume that my dataflow should be {$r0.a = 3, $r0.b = 4, $r0.c = 5} after line 2 and {$r0.a = 3, $r0.b = 4, $r0.c = 5, pythagoras.a = 3, pythagoras.b = 4, pythagoras.c = 5} after line 3, is that right?

2. When the constructor of Pythagoras is being called, the method normalFlowFunction is executed with inValue = {a = 3, b = 4, c = 5} (which is hopefully correct), but after the constructor invocation of Object

Code: Alles auswählen

specialinvoke this.<java.lang.Object: void <init>()>();
I end up with an empty inValue map, is that a bug in my implementation or am I missing something in my implementation?

3. When I analyze TargetClass1, the method callExitFlowFunction() is never called. My understanding of that method is that it should be called everytime a method call is analyzed (in order to map back variables from the callee's context). My problem in this context is that I don't know how and where to implement the logic of associating e.g. $r0.a = 3 in my program.
Zuletzt geändert von Vespertine am 11. Dez 2014 19:36, insgesamt 1-mal geändert.

Johannes Spaeth
Erstie
Erstie
Beiträge: 11
Registriert: 30. Okt 2014 13:29

Re: Sheet 4 Ex. 1a)

Beitrag von Johannes Spaeth »

Hi,

we noticed some problems of VASCO concerning the context. Some context were finally never analyzed, leading to wrong results.
We reported a bug fix in a pull request, which was merged in the github repository.

It looks like your issues are due to the facts that not all context are analysed. So please update your VASCO version and see if it resolves your problem.

Best regards,

Johannes

Vespertine
Erstie
Erstie
Beiträge: 16
Registriert: 8. Okt 2013 22:43

Re: Sheet 4 Ex. 1a)

Beitrag von Vespertine »

Yes this seems to resolve my issues, thanks. This cost me a lot of time though :/

Andreas Wittmann
Neuling
Neuling
Beiträge: 7
Registriert: 15. Okt 2014 23:52

Re: Sheet 4 Ex. 1a)

Beitrag von Andreas Wittmann »

Thanks johannes. Just removed my ugly workarround from 2 weeks ago when we first talked about the problem and still works fine.

Btw. Am i blind or is there really no way to invoke a BinOp expression in a generic way? I'm quite sick of if(... instance of mult) else if ( instanceof add)... i looked for something like a method in NumericConstant : NumericConstant.invoke(BinopExpr binop, NumericConstant op2). But neither in NumericConstant nor in BinopExpr such things exist.

Antworten

Zurück zu „Implementing code analyses for large software systems (ICA)“