GOTO-symex: propagate notequal conditions for boolean types [TG-9390] #5089
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Conditional branches on "x != false", as well as "x" and "!x", can and should lead to constant
propagation just as "x == true" does now. This is particularly beneficial for the
"clinit_already_run" variables that are maintained to determine if a static initialiser should
be run or not -- the current "if(already_run != true) clinit(); already_run = true;" condition
now leaves symex certain that it has been run at the bottom of the function regardless of the
already_run flag's initial value, whereas before it could remain uncertain and so explore the
static initialiser more than is necessary.
Command line to see the benefit of this change on Tika-parsers:
test-generator --java-max-vla-length 192 --unwind 2 --java-unwind-enum-static --trace --export-imports --java-assume-inputs-non-null --classpath ~/test-gen/lib/models-library/model/target/models.jar tika-all.jar --function 'org.apache.tika.parser.jdbc.JDBCTableReader.handleClob'
where
tika-all.jar
is a jar containing all of theorg/apache/tika
package from all Tika modules (i.e. tika-core, tika-parsers etc).