clair icon indicating copy to clipboard operation
clair copied to clipboard

Underapproximation in closeOverriddenVirtualCalls

Open linuswagner opened this issue 1 year ago • 1 comments

@synopsis{fills out the call graph by adding the tuples for possible actual methods and constructors, and removing the corresponding calls to virtual methods and constructors.}
rel[loc caller, loc callee] closeOverriddenVirtualCalls(M3 comp) {
  return comp.callGraph 
    + comp.callGraph o comp.methodOverrides // add the overridden definitions
    - rangeR(comp.callGraph, comp.methodOverrides<0>); // remove the virtual intermediates
}

See this example: There can be implementations for virtual methods. Therefore, the last line in the function creates an underapproximation and seems to be misleading

linuswagner avatar Feb 19 '24 15:02 linuswagner

Good catch Linus. Let's remove the removal altogether until we can remove only virtual methods without bodies.

jurgenvinju avatar Feb 19 '24 16:02 jurgenvinju