Skip to content

Java: Include two more base cases in TypeFlow to improve virtual dispatch.#1412

Merged
yh-semmle merged 1 commit intogithub:masterfrom
aschackmull:java/typeflow-basecases
Jun 10, 2019
Merged

Java: Include two more base cases in TypeFlow to improve virtual dispatch.#1412
yh-semmle merged 1 commit intogithub:masterfrom
aschackmull:java/typeflow-basecases

Conversation

@aschackmull
Copy link
Contributor

Two more cases where type information is lost are added as base cases in TypeFlow. For FunctionalExpr the type from getType() is based on the context, so getConstructedType() is more precise and a place where type information is immediately discarded. Type information can also be lost in a step from a method to a call if the static dispatch target has a more general declared return type than the actually called method.
The impact of this change is likely fairly minor (1348 removed tuples out of 4.8 million in the virtual dispatch relation on jdk9), but any precision improvement of virtual dispatch is a good thing.

@aschackmull aschackmull requested a review from a team as a code owner June 6, 2019 12:55
@yh-semmle yh-semmle merged commit 6c9d68d into github:master Jun 10, 2019
@aschackmull aschackmull deleted the java/typeflow-basecases branch June 11, 2019 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants