Update CFG to match changes to Call/MethodCall

This commit is contained in:
Nick Rolfe
2020-12-16 12:01:30 +00:00
parent aa0c1491a6
commit e98a84c8b5
3 changed files with 236 additions and 257 deletions

View File

@@ -319,10 +319,13 @@ module Trees {
}
private class CallTree extends StandardPostOrderTree, Call {
// this.getBlock() is not included as it uses a different scope
final override AstNode getChildNode(int i) {
result = this.getReceiver() and i = 0
result = this.getArguments() and i = 0
or
result = this.getMethod() and i = 1
result = this.getReceiver() and i = 1
or
result = this.getMethod() and i = 2
}
}
@@ -769,15 +772,6 @@ module Trees {
override predicate isHidden() { any() }
}
private class MethodCallTree extends StandardPostOrderTree, MethodCall {
// this.getBlock() is not included as it uses a different scope
final override AstNode getChildNode(int i) {
result = this.getArguments() and i = 0
or
result = this.getMethod() and i = 1
}
}
private class MethodParametersTree extends StandardPreOrderTree, MethodParameters {
final override AstNode getChildNode(int i) { result = this.getChild(i) }

View File

@@ -9,13 +9,13 @@ abstract class NonReturningCall extends AstNode {
abstract Completion getACompletion();
}
private class RaiseCall extends NonReturningCall, MethodCall {
private class RaiseCall extends NonReturningCall, Call {
RaiseCall() { this.getMethod().toString() = "raise" }
override RaiseCompletion getACompletion() { not result instanceof NestedCompletion }
}
private class ExitCall extends NonReturningCall, MethodCall {
private class ExitCall extends NonReturningCall, Call {
ExitCall() { this.getMethod().toString() in ["abort", "exit"] }
override ExitCompletion getACompletion() { not result instanceof NestedCompletion }

File diff suppressed because it is too large Load Diff