Cfg: Fold getTryInit into indexed getBody.

This commit is contained in:
Anders Schack-Mulligen
2026-06-08 14:01:24 +02:00
parent 3cbc8f0262
commit 01173bf383
3 changed files with 24 additions and 32 deletions

View File

@@ -117,15 +117,18 @@ private module Ast implements AstSig<Location> {
final private class FinalTryStmt = J::TryStmt;
class TryStmt extends FinalTryStmt {
Stmt getBody() { result = super.getBlock() }
Stmt getBody(int index) {
result = super.getResource(index)
or
index = count(super.getAResource()) and
result = super.getBlock()
}
CatchClause getCatch(int index) { result = super.getCatchClause(index) }
Stmt getFinally() { result = super.getFinally() }
}
AstNode getTryInit(TryStmt try, int index) { result = try.getResource(index) }
final private class FinalCatchClause = J::CatchClause;
class CatchClause extends FinalCatchClause {