Path-sensitive static analysis
AssigneeOracle International Corporation
InventorsNathan Robert Albert Keynes, Eric Beguet
Life of this patent
Estimating the term…
Abstract
A method may include obtaining, from one of the rules of a static analysis, a built-in path relation describing a path constraint on a path variable, generating, using the rules, a transfer function that updates a property vector while analyzing code, generating an evaluation function that determines, using the updated property vector, whether the static analysis is satisfied, and determining whether the code includes a defect by executing the static analysis on the code using the path constraint, the transfer function, and the evaluation function.
Claims19
A method, comprising:
- obtaining, from a rule of a plurality of rules of a static analysis, a built-in path relation describing a path constraint on a path variable, wherein the built-in path relation comprises a path condition;
- generating, using the plurality of rules, a transfer function that updates a property vector while analyzing code;
- generating an evaluation function that determines, using the updated property vector, whether the static analysis is satisfied;
- and
- determining whether the code comprises a defect by executing the static analysis on the code using the path constraint, the transfer function, and the evaluation function, wherein executing the static analysis comprises determining whether a branch condition of the code satisfies the path condition.
A system, comprising:
- a memory coupled to a computer processor;
- a repository configured to store code, a property vector, and a static analysis comprising a plurality of rules;
- a code analyzer, executing on the computer processor and using the memory, configured to:
- obtain, from a rule of the plurality of rules, a built-in path relation describing a path constraint on a path variable, wherein the built-in path relation comprises a path condition,
- generate, using the plurality of rules, a transfer function that updates the property vector while analyzing the code, and
- generate an evaluation function that determines, using the updated property vector, whether the static analysis is satisfied;
- and
- a dataflow engine, executing on the computer processor and using the memory, configured to determine whether the code comprises a defect by executing the static analysis on the code using the path constraint, the transfer function, and the evaluation function, wherein executing the static analysis comprises determining whether a branch condition of the code satisfies the path condition.
A non-transitory computer readable medium comprising instructions that, when executed by a computer processor, perform:
- obtaining, from a rule of a plurality of rules of a static analysis, a built-in path relation describing a path constraint on a path variable, wherein the built-in path relation comprises a path condition;
- generating, using the plurality of rules, a transfer function that updates a property vector while analyzing code;
- generating an evaluation function that determines, using the updated property vector, whether the static analysis is satisfied;
- and
- determining whether the code comprises a defect by executing the static analysis on the code using the path constraint, the transfer function, and the evaluation function, wherein executing the static analysis comprises determining whether a branch condition of the code satisfies the path condition.
A method, comprising:
- obtaining, from a rule of a plurality of rules of a static analysis, a built-in path relation describing a path constraint on a path variable;
- identifying a correlated variable comprised by a subset of the plurality of rules;
- generating a property vector by creating a flag for an expression that defines a value of the correlated variable;
- generating, using the plurality of rules, a transfer function that updates the property vector while analyzing code;
- generating an evaluation function that determines, using the updated property vector, whether the static analysis is satisfied;
- and
- determining whether the code comprises a defect by executing the static analysis on the code using the path constraint, the transfer function, and the evaluation function.
A system, comprising:
- a memory coupled to a computer processor;
- a repository configured to store code, a property vector, and a static analysis comprising a plurality of rules;
- a code analyzer, executing on the computer processor and using the memory, configured to:
- obtain, from a rule of the plurality of rules, a built-in path relation describing a path constraint on a path variable,
- identify a correlated variable comprised by a subset of the plurality of rules,
- generate a property vector by creating a flag for an expression that defines a value of the correlated variable,
- generate, using the plurality of rules, a transfer function that updates the property vector while analyzing the code, and
- generate an evaluation function that determines, using the updated property vector, whether the static analysis is satisfied;
- and
- a dataflow engine, executing on the computer processor and using the memory, configured to determine whether the code comprises a defect by executing the static analysis on the code using the path constraint, the transfer function, and the evaluation function.
A non-transitory computer readable medium comprising instructions that, when executed by a computer processor, perform:
- obtaining, from a rule of a plurality of rules of a static analysis, a built-in path relation describing a path constraint on a path variable;
- identifying a correlated variable comprised by a subset of the plurality of rules;
- generating a property vector by creating a flag for an expression that defines a value of the correlated variable;
- generating, using the plurality of rules, a transfer function that updates the property vector while analyzing code;
- generating an evaluation function that determines, using the updated property vector, whether the static analysis is satisfied;
- and
- determining whether the code comprises a defect by executing the static analysis on the code using the path constraint, the transfer function, and the evaluation function.
Dependencies are inferred from the claim text.