Improvement of the PerformInvocations domain

Issue #125 resolved
florian_kuebler created an issue

The l2 PerformInvocations domain currently only supports identity-like functions, if the return value must be a single parameter of the method. It would be useful to get this information also for parameters that may be return value.

def foo(b: Boolean) = {
  val x = new Object()
  val y = semiIdentity(x, b)
}

def semiIdentity(x: Any, b: Boolean) = {
  if(b)
    x
  else
    null
}

For the given example it is desirable to know that value y could be the same as x and that this is reflected in the TAC.

Comments (4)

  1. Michael Eichberg repo owner

    Actually, this shouldn't be hard - we just need to adapt the function that maps the values back to the original domain. What we would need to do is to unify all values that were created in the called method and correctly remap the others. Given that we only track "must-alias" information, nothing should go wrong.

  2. Michael Eichberg repo owner

    I will soon publish a fix for the issue that is reported; however more improvements are easily possible in specialized sub classes which make use of the information provided by specific domains (in particular the l1.ReferenceValuesDomain); I have added a respective comment to PerformInvocations.

  3. Log in to comment