ProgQuery is a system to extract useful syntactic and semantic information from source code programs and store it in a graph database for posterior querying.
MIT License
15
stars
4
forks
source link
Updating CFG to use information from javac relative to checked exceptions that can be thrown by methods #7
Instead of storing information about checked exceptions in the signature of each analysed method, we can use information from javac. This will make the CFG analysis to be more efficient and allows to get information about checked exceptions even for methods that are not declared (but they are invoked).
Also, storing different subtrees of the AST to perform the CFG analysis in a second pass is not necessary any more. We can build the AST, CFG and the first part of the PDG and the CG in the first pass. This will fix various errors that arise from the transformations that javac perform in the trees during the compilation process (e. g. transforming "assert (cond)" construct into "if (DEBUG_FLAG && !cond) throw new AssertionError" or transforming for each loops into traditional loops).
Two main updates:
Instead of storing information about checked exceptions in the signature of each analysed method, we can use information from javac. This will make the CFG analysis to be more efficient and allows to get information about checked exceptions even for methods that are not declared (but they are invoked).
Also, storing different subtrees of the AST to perform the CFG analysis in a second pass is not necessary any more. We can build the AST, CFG and the first part of the PDG and the CG in the first pass. This will fix various errors that arise from the transformations that javac perform in the trees during the compilation process (e. g. transforming "assert (cond)" construct into "if (DEBUG_FLAG && !cond) throw new AssertionError" or transforming for each loops into traditional loops).