Java: Apply deadcode guard to data flow nodes.#11712
Java: Apply deadcode guard to data flow nodes.#11712aschackmull merged 4 commits intogithub:mainfrom
Conversation
|
The qltests caught a small corner-case: In ArrayIndexOutOfBounds.ql if we would previously catch a case based on a relative bound to an array length field access that happened to be a constant due to the array being defined in a final field and with a fixed length, then the additional constant propagation means that such a length access plus another constant is now found up front to be a constant, and thus the relative bound becomes superfluous, but the query didn't properly account for that case. This is now fixed. I've started an additional dca just for that query. |
|
Looks like this causes ArrayIndexOutOfBounds.ql to catch a few more results, but it apparently also loses a few - that's worth an additional look before merging. |
|
|
|
^ |
525f7e9 to
2d6d8aa
Compare
One result lost to the very slight change in SSA precision for fields, and two results lost that turned out to actually be FPs. |
Feel free to add some as a follow-up. I wanted to merge this sooner rather than later, since it had been open for so long. |
|
Makes sense. Thanks for implementing this, I will definitely give this a test this week. |


Refactors the compile-time constant computation, such that we can reuse it for more general constant calculations.
Use this to define a trivial dead-code guard and apply it to data flow nodes to filter all flow through dead code.
It was necessary to reshuffle the dependencies between SSA, virtual dispatch, and data flow nodes a bit in order to be able to refer to SSA from data flow nodes. This means that field SSA uses a slightly lower precision virtual dispatch in the determination of uncertain updates of field-SSA variables. This is in line with what's also done in C#.