diff --git a/ql/src/codeql_ruby/ast/Literal.qll b/ql/src/codeql_ruby/ast/Literal.qll index 2354084910a..ce0825cce92 100644 --- a/ql/src/codeql_ruby/ast/Literal.qll +++ b/ql/src/codeql_ruby/ast/Literal.qll @@ -523,6 +523,16 @@ class CharacterLiteral extends Literal, TCharacterLiteral { final override string getAPrimaryQlClass() { result = "CharacterLiteral" } } +pragma[noinline] +private predicate rankHeredocBody(File f, Generated::HeredocBody b, int i) { + b = + rank[i](Generated::HeredocBody b0 | + f = b0.getLocation().getFile() + | + b0 order by b0.getLocation().getStartLine(), b0.getLocation().getStartColumn() + ) +} + /** * A "here document". For example: * ```rb @@ -589,12 +599,7 @@ class HereDoc extends StringlikeLiteral, THereDoc { | b order by b.getLocation().getStartLine(), b.getLocation().getStartColumn() ) and - result = - rank[i](Generated::HeredocBody b | - f = b.getLocation().getFile() - | - b order by b.getLocation().getStartLine(), b.getLocation().getStartColumn() - ) + rankHeredocBody(f, result, i) ) }