Skip to content

Commit 952e495

Browse files
author
Dave Bartolomeo
committed
New SemanticExpr implementation
Cleans up SignAnalysis to reduce need for language-specific enhancements
1 parent 02bf008 commit 952e495

15 files changed

Lines changed: 795 additions & 431 deletions

File tree

java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,3 +374,11 @@ predicate strictlyNegative(Expr e) {
374374
not exprSign(e) = TPos() and
375375
not exprSign(e) = TZero()
376376
}
377+
378+
/**
379+
* Expose some predicates for testing purposes without making them implicitly public to any module
380+
* that imports this file.
381+
*/
382+
module SignAnalysisCommonTest {
383+
predicate testSsaDefSign = ssaDefSign/1;
384+
}

java/ql/lib/semmle/code/java/semantic/SemanticCFG.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
private import java
66
private import SemanticExpr
7+
private import SemanticExprSpecific
78

89
private newtype TSemBasicBlock = MkSemBasicBlock(BasicBlock block)
910

@@ -14,6 +15,8 @@ class SemBasicBlock extends TSemBasicBlock {
1415

1516
final string toString() { result = block.toString() }
1617

18+
final Location getLocation() { result = block.getLocation() }
19+
1720
final predicate bbDominates(SemBasicBlock otherBlock) {
1821
block.bbDominates(getJavaBasicBlock(otherBlock))
1922
}

0 commit comments

Comments
 (0)