From c866f884108fba3c0954529300f47ca3f45425ff Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 18 May 2021 20:24:46 +0200 Subject: [PATCH] CFG: Add missing `propagatesAbnormal` overrides --- .../controlflow/internal/ControlFlowGraphImpl.qll | 4 ++++ ql/test/library-tests/controlflow/graph/Cfg.expected | 9 --------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/ql/src/codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll b/ql/src/codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll index 00fd66d8f24..824ea6af3fd 100644 --- a/ql/src/codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll +++ b/ql/src/codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll @@ -880,6 +880,8 @@ module Trees { } private class LambdaTree extends BodyStmtTree, Lambda { + final override predicate propagatesAbnormal(AstNode child) { none() } + /** Gets the `i`th child in the body of this block. */ final override AstNode getBodyChild(int i, boolean rescuable) { result = this.getParameter(i) and rescuable = false @@ -1158,6 +1160,8 @@ module Trees { } private class SingletonMethodTree extends BodyStmtTree, SingletonMethod { + final override predicate propagatesAbnormal(AstNode child) { none() } + /** Gets the `i`th child in the body of this block. */ final override AstNode getBodyChild(int i, boolean rescuable) { result = this.getParameter(i) and rescuable = false diff --git a/ql/test/library-tests/controlflow/graph/Cfg.expected b/ql/test/library-tests/controlflow/graph/Cfg.expected index 37ae08e9dbc..0f839d6d344 100644 --- a/ql/test/library-tests/controlflow/graph/Cfg.expected +++ b/ql/test/library-tests/controlflow/graph/Cfg.expected @@ -3173,9 +3173,6 @@ raise.rb: # 1| exit raise.rb -# 1| exit raise.rb (abnormal) -#-----| -> exit raise.rb - # 1| exit raise.rb (normal) #-----| -> exit raise.rb @@ -4333,9 +4330,6 @@ raise.rb: # 159| exit do ... end -# 159| exit do ... end (abnormal) -#-----| -> exit do ... end - # 159| exit do ... end (normal) #-----| -> exit do ... end @@ -4363,7 +4357,6 @@ raise.rb: #-----| -> x # 161| call to raise -#-----| raise -> exit do ... end (abnormal) #-----| raise -> exit -> { ... } (abnormal) # 161| ... unless ... @@ -4397,9 +4390,7 @@ raise.rb: #-----| -> m # 168| call to raise -#-----| raise -> C #-----| raise -> exit m (abnormal) -#-----| raise -> exit raise.rb (abnormal) # 168| self #-----| -> ""