Skip to content

Shared/Java: Add shared Guards library and switch Java to use it. #19573

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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4a70357
Java: Add guards-logic qltest with inline expectation.
aschackmull May 1, 2025
84da2fc
Java: Add hasInputFromBlock predicate in BaseSSA.
aschackmull May 2, 2025
28f6c07
Shared: Add a shared Guards library inspired by the Java and C# versi…
aschackmull May 2, 2025
54631f9
Shared: Extend the shared Guards library with support for custom wrap…
aschackmull May 13, 2025
7dae428
Shared: Extend the shared Guards library with support for exception b…
aschackmull May 15, 2025
37857a0
Shared: Improve shared guards lib.
aschackmull May 20, 2025
0fb2e81
Shared: Many tweaks to Guards.
aschackmull May 23, 2025
4a8a8d3
Shared: Elaborate qldoc.
aschackmull May 23, 2025
f303b10
Shared: Switch case guards to be the case statements.
aschackmull May 26, 2025
13addf0
Shared: Simplify and improve joins.
aschackmull May 27, 2025
822dbd5
Shared: Bugfix for unique value implication.
aschackmull Jun 16, 2025
fa21280
Java: Refactor clearlyNotNullExpr into a base case that does not rely…
aschackmull May 14, 2025
5875400
Java: Refactor integerGuard.
aschackmull May 19, 2025
46c05df
Java: Replace some references to basicNullGuard.
aschackmull May 21, 2025
4ec29b4
Java: Switch to the shared Guards library.
aschackmull May 15, 2025
9e466af
Java: Fix qltests
aschackmull May 27, 2025
00f96ef
Java: Fix perf issue.
aschackmull May 27, 2025
dbf272e
Shared: Try caching.
aschackmull Jun 16, 2025
3c9dc16
Java: Fix perf issue.
aschackmull Jun 17, 2025
ed640ab
Java: document FP
aschackmull Jun 17, 2025
dcb8ea2
Java: Add change note.
aschackmull Jun 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions java/ql/lib/semmle/code/java/controlflow/BasicBlocks.qll
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ class BasicBlock extends BbImpl::BasicBlock {
*/
predicate dominates(BasicBlock bb) { super.dominates(bb) }

/**
* Holds if this basic block strictly dominates basic block `bb`.
*
* That is, all paths reaching `bb` from the entry point basic block must
* go through this basic block and this basic block is different from `bb`.
*/
predicate strictlyDominates(BasicBlock bb) { super.strictlyDominates(bb) }

/** Gets an immediate successor of this basic block of a given type, if any. */
BasicBlock getASuccessor(Input::SuccessorType t) { result = super.getASuccessor(t) }

/**
* DEPRECATED: Use `getASuccessor` instead.
*
Expand Down
Loading
Loading