Skip to content

Commit 174ba25

Browse files
committed
Update SystemCommandExecution to new pattern
The new pattern is to use the new instanceof keyword in the class definition, instead of constraining the "superclass" via a member field.
1 parent cbc14cc commit 174ba25

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

ql/lib/codeql/ruby/Concepts.qll

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -318,16 +318,12 @@ module HTTP {
318318
* A data flow node that executes an operating system command,
319319
* for instance by spawning a new process.
320320
*/
321-
class SystemCommandExecution extends DataFlow::Node {
322-
SystemCommandExecution::Range range;
323-
324-
SystemCommandExecution() { this = range }
325-
321+
class SystemCommandExecution extends DataFlow::Node instanceof SystemCommandExecution::Range {
326322
/** Holds if a shell interprets `arg`. */
327-
predicate isShellInterpreted(DataFlow::Node arg) { range.isShellInterpreted(arg) }
323+
predicate isShellInterpreted(DataFlow::Node arg) { super.isShellInterpreted(arg) }
328324

329325
/** Gets an argument to this execution that specifies the command or an argument to it. */
330-
DataFlow::Node getAnArgument() { result = range.getAnArgument() }
326+
DataFlow::Node getAnArgument() { result = super.getAnArgument() }
331327
}
332328

333329
module SystemCommandExecution {

0 commit comments

Comments
 (0)