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.
This commit is contained in:
Harry Maclean
2021-09-07 14:05:54 +01:00
parent cbc14ccda9
commit 174ba25c66

View File

@@ -318,16 +318,12 @@ module HTTP {
* A data flow node that executes an operating system command,
* for instance by spawning a new process.
*/
class SystemCommandExecution extends DataFlow::Node {
SystemCommandExecution::Range range;
SystemCommandExecution() { this = range }
class SystemCommandExecution extends DataFlow::Node instanceof SystemCommandExecution::Range {
/** Holds if a shell interprets `arg`. */
predicate isShellInterpreted(DataFlow::Node arg) { range.isShellInterpreted(arg) }
predicate isShellInterpreted(DataFlow::Node arg) { super.isShellInterpreted(arg) }
/** Gets an argument to this execution that specifies the command or an argument to it. */
DataFlow::Node getAnArgument() { result = range.getAnArgument() }
DataFlow::Node getAnArgument() { result = super.getAnArgument() }
}
module SystemCommandExecution {