Skip to content

GOTO-symex: propagate notequal conditions for boolean types [TG-9390] #5089

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

smowton
Copy link
Contributor

@smowton smowton commented Sep 5, 2019

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 the org/apache/tika package from all Tika modules (i.e. tika-core, tika-parsers etc).

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.
@smowton smowton changed the title GOTO-symex: propagate notequal conditions for boolean types GOTO-symex: propagate notequal conditions for boolean types [TG-9390] Sep 5, 2019
@owen-mc-diffblue
Copy link
Contributor

I'm taking this work over, so I have to close this PR and open a new: #5091

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants