We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e07f45f commit ea0278eCopy full SHA for ea0278e
1 file changed
ruby/ql/lib/codeql/ruby/ast/Erb.qll
@@ -156,14 +156,22 @@ class ErbDirective extends TDirectiveNode, ErbAstNode {
156
)
157
}
158
159
+ pragma[nomagic]
160
+ private Stmt getAChildStmt0() {
161
+ this.containsAstNodeStart(result) and
162
+ not this.containsAstNodeStart(result.getParent())
163
+ }
164
+
165
/**
166
* Gets a statement that starts in directive that is not a child of any other
167
* statement starting in this directive.
168
*/
169
cached
170
Stmt getAChildStmt() {
- this.containsAstNodeStart(result) and
- not this.containsAstNodeStart(result.getParent())
171
+ result = this.getAChildStmt0() and
172
+ not result instanceof BodyStmt
173
+ or
174
+ result = this.getAChildStmt0().(BodyStmt).getAStmt()
175
176
177
0 commit comments