From f3852f9b567fcbe16d75285a2a1a2effb2d95dde Mon Sep 17 00:00:00 2001 From: Nick Rolfe Date: Wed, 28 Apr 2021 16:43:40 +0100 Subject: [PATCH] Create synthetic `self` nodes for calls without explicit receivers --- ql/src/codeql_ruby/AST.qll | 8 +- ql/src/codeql_ruby/ast/Call.qll | 6 + ql/src/codeql_ruby/ast/Expr.qll | 4 + ql/src/codeql_ruby/ast/internal/AST.qll | 31 +- .../codeql_ruby/controlflow/BasicBlocks.qll | 4 +- .../internal/ControlFlowGraphImpl.qll | 3 +- ql/test/library-tests/ast/Ast.expected | 126 +++++ .../library-tests/ast/calls/calls.expected | 171 +++--- .../controlflow/graph/Cfg.expected | 533 +++++++++++++++--- ql/test/library-tests/variables/ssa.expected | 48 +- 10 files changed, 744 insertions(+), 190 deletions(-) diff --git a/ql/src/codeql_ruby/AST.qll b/ql/src/codeql_ruby/AST.qll index 518f42c69d9..244b82b2ecc 100644 --- a/ql/src/codeql_ruby/AST.qll +++ b/ql/src/codeql_ruby/AST.qll @@ -32,14 +32,16 @@ class AstNode extends TAstNode { /** Gets the enclosing module, if any. */ ModuleBase getEnclosingModule() { exists(Scope::Range s | - s = scopeOf(toGenerated(this)) and toGenerated(result) = s.getEnclosingModule() + s = scopeOf(toGeneratedInclSynth(this)) and + toGeneratedInclSynth(result) = s.getEnclosingModule() ) } /** Gets the enclosing method, if any. */ MethodBase getEnclosingMethod() { exists(Scope::Range s | - s = scopeOf(toGenerated(this)) and toGenerated(result) = s.getEnclosingMethod() + s = scopeOf(toGeneratedInclSynth(this)) and + toGeneratedInclSynth(result) = s.getEnclosingMethod() ) } @@ -48,7 +50,7 @@ class AstNode extends TAstNode { string toString() { none() } /** Gets the location of this node. */ - Location getLocation() { result = toGenerated(this).getLocation() } + Location getLocation() { result = toGeneratedInclSynth(this).getLocation() } /** Gets a child node of this `AstNode`. */ final AstNode getAChild() { result = this.getAChild(_) } diff --git a/ql/src/codeql_ruby/ast/Call.qll b/ql/src/codeql_ruby/ast/Call.qll index 366aab182a1..bc2231d94f3 100644 --- a/ql/src/codeql_ruby/ast/Call.qll +++ b/ql/src/codeql_ruby/ast/Call.qll @@ -136,6 +136,8 @@ private class IdentifierMethodCall extends MethodCall, TIdentifierMethodCall { IdentifierMethodCall() { this = TIdentifierMethodCall(g) } final override string getMethodName() { result = getMethodName(this, g.getValue()) } + + final override Self getReceiver() { result = TIdentifierMethodCallImplicitSelf(g) } } private class ScopeResolutionMethodCall extends MethodCall, TScopeResolutionMethodCall { @@ -159,6 +161,10 @@ private class RegularMethodCall extends MethodCall, TRegularMethodCall { or not exists(g.getReceiver()) and toGenerated(result) = g.getMethod().(Generated::ScopeResolution).getScope() + or + not exists(g.getReceiver()) and + not exists(g.getMethod().(Generated::ScopeResolution).getScope()) and + result = TRegularMethodCallImplicitSelf(g) } final override string getMethodName() { diff --git a/ql/src/codeql_ruby/ast/Expr.qll b/ql/src/codeql_ruby/ast/Expr.qll index 4e44bc98a25..59bd9335a8c 100644 --- a/ql/src/codeql_ruby/ast/Expr.qll +++ b/ql/src/codeql_ruby/ast/Expr.qll @@ -14,6 +14,10 @@ class Expr extends Stmt, TExpr { } * - `self == other` * - `self.method_name` * - `def self.method_name ... end` + * + * This also includes implicit references to the current object in method + * calls. For example, the method call `foo(123)` has an implicit `self` + * receiver, and is equivalent to the explicit `self.foo(123)`. */ class Self extends Expr, TSelf { final override string getAPrimaryQlClass() { result = "Self" } diff --git a/ql/src/codeql_ruby/ast/internal/AST.qll b/ql/src/codeql_ruby/ast/internal/AST.qll index 26e2e6149c3..f193ec558f8 100644 --- a/ql/src/codeql_ruby/ast/internal/AST.qll +++ b/ql/src/codeql_ruby/ast/internal/AST.qll @@ -103,6 +103,7 @@ private module Cached { TEndBlock(Generated::EndBlock g) or TEnsure(Generated::Ensure g) or TEqExpr(Generated::Binary g) { g instanceof @binary_equalequal } or + TExplicitSelf(Generated::Self g) or TExponentExpr(Generated::Binary g) { g instanceof @binary_starstar } or TFalseLiteral(Generated::False g) or TFloatLiteral(Generated::Float g) { not any(Generated::Rational r).getChild() = g } or @@ -119,6 +120,7 @@ private module Cached { THashSplatParameter(Generated::HashSplatParameter g) or THereDoc(Generated::HeredocBeginning g) or TIdentifierMethodCall(Generated::Identifier g) { vcall(g) and not access(g, _) } or + TIdentifierMethodCallImplicitSelf(Generated::Identifier g) { vcall(g) and not access(g, _) } or TIf(Generated::If g) or TIfModifierExpr(Generated::IfModifier g) or TInstanceVariableAccess(Generated::InstanceVariable g, AST::InstanceVariable v) { @@ -158,6 +160,11 @@ private module Cached { TRegexMatchExpr(Generated::Binary g) { g instanceof @binary_equaltilde } or TRegularArrayLiteral(Generated::Array g) or TRegularMethodCall(Generated::Call g) { not g.getMethod() instanceof Generated::Super } or + TRegularMethodCallImplicitSelf(Generated::Call g) { + not g.getMethod() instanceof Generated::Super and + not exists(g.getReceiver()) and + not exists(g.getMethod().(Generated::ScopeResolution).getScope()) + } or TRegularStringLiteral(Generated::String g) or TRegularSuperCall(Generated::Call g) { g.getMethod() instanceof Generated::Super } or TRescueClause(Generated::Rescue g) or @@ -179,7 +186,6 @@ private module Cached { i = g.getName() and not exists(Generated::Call c | c.getMethod() = g) } or - TSelf(Generated::Self g) or TSimpleParameter(Generated::Identifier g) { g instanceof Parameter::Range } or TSimpleSymbolLiteral(Generated::SimpleSymbol g) or TSingletonClass(Generated::SingletonClass g) or @@ -223,7 +229,11 @@ private module Cached { TWhileModifierExpr(Generated::WhileModifier g) or TYieldCall(Generated::Yield g) - /** Gets the underlying TreeSitter entity for a given AST node. */ + /** + * Gets the underlying TreeSitter entity for a given AST node. This does not + * include synthesized AST nodes, because they are not the primary AST node + * for any given generated node. + */ cached Generated::AstNode toGenerated(AST::AstNode n) { n = TAddExpr(result) or @@ -274,6 +284,7 @@ private module Cached { n = TEndBlock(result) or n = TEnsure(result) or n = TEqExpr(result) or + n = TExplicitSelf(result) or n = TExponentExpr(result) or n = TFalseLiteral(result) or n = TFloatLiteral(result) or @@ -329,7 +340,6 @@ private module Cached { n = TReturnStmt(result) or n = TScopeResolutionConstantAccess(result, _) or n = TScopeResolutionMethodCall(result, _) or - n = TSelf(result) or n = TSimpleParameter(result) or n = TSimpleSymbolLiteral(result) or n = TSingletonClass(result) or @@ -365,12 +375,25 @@ private module Cached { n = TWhileModifierExpr(result) or n = TYieldCall(result) } + + /** + * Like `toGenerated`, but also returns generated nodes for synthesized AST + * nodes. + */ + cached + Generated::AstNode toGeneratedInclSynth(AST::AstNode n) { + result = toGenerated(n) or + n = TIdentifierMethodCallImplicitSelf(result) or + n = TRegularMethodCallImplicitSelf(result) + } } import Cached TAstNode fromGenerated(Generated::AstNode n) { n = toGenerated(result) } +TAstNode fromGeneratedInclSynth(Generated::AstNode n) { n = toGeneratedInclSynth(result) } + class TCall = TMethodCall or TYieldCall; class TMethodCall = @@ -392,6 +415,8 @@ class TConditionalLoop = TWhileExpr or TUntilExpr or TWhileModifierExpr or TUnti class TLoop = TConditionalLoop or TForExpr; +class TSelf = TExplicitSelf or TIdentifierMethodCallImplicitSelf or TRegularMethodCallImplicitSelf; + class TExpr = TSelf or TArgumentList or TRescueClause or TRescueModifierExpr or TPair or TStringConcatenation or TCall or TBlockArgument or TSplatArgument or THashSplatArgument or TConstantAccess or diff --git a/ql/src/codeql_ruby/controlflow/BasicBlocks.qll b/ql/src/codeql_ruby/controlflow/BasicBlocks.qll index 2926d00fe18..6fdfd110637 100644 --- a/ql/src/codeql_ruby/controlflow/BasicBlocks.qll +++ b/ql/src/codeql_ruby/controlflow/BasicBlocks.qll @@ -358,9 +358,9 @@ private module JoinBlockPredecessors { private predicate idOf(Generated::AstNode x, int y) = equivalenceRelation(id/2)(x, y) int getId(JoinBlockPredecessor jbp) { - idOf(toGenerated(jbp.getFirstNode().(AstCfgNode).getNode()), result) + idOf(toGeneratedInclSynth(jbp.getFirstNode().(AstCfgNode).getNode()), result) or - idOf(toGenerated(jbp.(EntryBasicBlock).getScope()), result) + idOf(toGeneratedInclSynth(jbp.(EntryBasicBlock).getScope()), result) } string getSplitString(JoinBlockPredecessor jbp) { diff --git a/ql/src/codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll b/ql/src/codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll index a648a2c1b71..aefc449cb45 100644 --- a/ql/src/codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll +++ b/ql/src/codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll @@ -1318,7 +1318,8 @@ private module Cached { /** Gets the CFG scope of node `n`. */ cached CfgScope getCfgScopeImpl(AstNode n) { - result = parent*(ASTInternal::fromGenerated(scopeOf(ASTInternal::toGenerated(n)))) + result = + parent*(ASTInternal::fromGeneratedInclSynth(scopeOf(ASTInternal::toGeneratedInclSynth(n)))) } private predicate isAbnormalExitType(SuccessorType t) { diff --git a/ql/test/library-tests/ast/Ast.expected b/ql/test/library-tests/ast/Ast.expected index 7078ea3c675..7f5e877af1c 100644 --- a/ql/test/library-tests/ast/Ast.expected +++ b/ql/test/library-tests/ast/Ast.expected @@ -1,16 +1,20 @@ calls/calls.rb: # 1| [Toplevel] calls.rb # 2| getStmt: [MethodCall] call to foo +# 2| getReceiver: [Self] self # 5| getStmt: [MethodCall] call to bar # 5| getReceiver: [ConstantReadAccess] Foo # 8| getStmt: [MethodCall] call to bar +# 8| getReceiver: [Self] self # 11| getStmt: [MethodCall] call to bar # 11| getReceiver: [IntegerLiteral] 123 # 14| getStmt: [MethodCall] call to foo +# 14| getReceiver: [Self] self # 14| getArgument: [IntegerLiteral] 0 # 14| getArgument: [IntegerLiteral] 1 # 14| getArgument: [IntegerLiteral] 2 # 17| getStmt: [MethodCall] call to foo +# 17| getReceiver: [Self] self # 17| getBlock: [BraceBlock] { ... } # 17| getParameter: [SimpleParameter] x # 17| getDefiningAccess: [LocalVariableAccess] x @@ -18,6 +22,7 @@ calls/calls.rb: # 17| getAnOperand/getLeftOperand: [LocalVariableAccess] x # 17| getAnOperand/getRightOperand: [IntegerLiteral] 1 # 20| getStmt: [MethodCall] call to foo +# 20| getReceiver: [Self] self # 20| getBlock: [DoBlock] do ... end # 20| getParameter: [SimpleParameter] x # 20| getDefiningAccess: [LocalVariableAccess] x @@ -41,26 +46,33 @@ calls/calls.rb: # 36| getArgument: [IntegerLiteral] 100 # 36| getArgument: [IntegerLiteral] 200 # 46| getStmt: [MethodCall] call to foo +# 46| getReceiver: [Self] self # 47| getStmt: [MethodCall] call to foo # 47| getReceiver: [ConstantReadAccess] X # 50| getStmt: [ParenthesizedExpr] ( ... ) # 50| getStmt: [MethodCall] call to foo +# 50| getReceiver: [Self] self # 51| getStmt: [ParenthesizedExpr] ( ... ) # 51| getStmt: [MethodCall] call to foo # 51| getReceiver: [ConstantReadAccess] X # 54| getStmt: [MethodCall] call to some_func +# 54| getReceiver: [Self] self # 54| getArgument: [MethodCall] call to foo +# 54| getReceiver: [Self] self # 55| getStmt: [MethodCall] call to some_func +# 55| getReceiver: [Self] self # 55| getArgument: [MethodCall] call to foo # 55| getReceiver: [ConstantReadAccess] X # 58| getStmt: [ArrayLiteral] [...] # 58| getElement: [MethodCall] call to foo +# 58| getReceiver: [Self] self # 59| getStmt: [ArrayLiteral] [...] # 59| getElement: [MethodCall] call to foo # 59| getReceiver: [ConstantReadAccess] X # 62| getStmt: [AssignExpr] ... = ... # 62| getAnOperand/getLeftOperand: [LocalVariableAccess] var1 # 62| getAnOperand/getRightOperand: [MethodCall] call to foo +# 62| getReceiver: [Self] self # 63| getStmt: [AssignExpr] ... = ... # 63| getAnOperand/getLeftOperand: [LocalVariableAccess] var1 # 63| getAnOperand/getRightOperand: [MethodCall] call to foo @@ -68,6 +80,7 @@ calls/calls.rb: # 66| getStmt: [AssignAddExpr] ... += ... # 66| getAnOperand/getLeftOperand: [LocalVariableAccess] var1 # 66| getAnOperand/getRightOperand: [MethodCall] call to bar +# 66| getReceiver: [Self] self # 67| getStmt: [AssignAddExpr] ... += ... # 67| getAnOperand/getLeftOperand: [LocalVariableAccess] var1 # 67| getAnOperand/getRightOperand: [MethodCall] call to bar @@ -76,49 +89,64 @@ calls/calls.rb: # 70| getAnOperand/getLeftOperand: [LocalVariableAccess] var1 # 70| getAnOperand/getRightOperand: [ArgumentList] ..., ... # 70| getElement: [MethodCall] call to foo +# 70| getReceiver: [Self] self # 70| getElement: [MethodCall] call to bar # 70| getReceiver: [ConstantReadAccess] X # 73| getStmt: [BeginExpr] begin ... # 74| getStmt: [MethodCall] call to foo +# 74| getReceiver: [Self] self # 75| getStmt: [MethodCall] call to foo # 75| getReceiver: [ConstantReadAccess] X # 79| getBeginBlock: [BeginBlock] BEGIN { ... } # 79| getStmt: [MethodCall] call to foo +# 79| getReceiver: [Self] self # 79| getStmt: [MethodCall] call to bar # 79| getReceiver: [ConstantReadAccess] X # 82| getStmt: [EndBlock] END { ... } # 82| getStmt: [MethodCall] call to foo +# 82| getReceiver: [Self] self # 82| getStmt: [MethodCall] call to bar # 82| getReceiver: [ConstantReadAccess] X # 85| getStmt: [AddExpr] ... + ... # 85| getAnOperand/getLeftOperand: [MethodCall] call to foo +# 85| getReceiver: [Self] self # 85| getAnOperand/getRightOperand: [MethodCall] call to bar # 85| getReceiver: [ConstantReadAccess] X # 88| getStmt: [NotExpr] ! ... # 88| getAnOperand/getOperand: [MethodCall] call to foo +# 88| getReceiver: [Self] self # 89| getStmt: [ComplementExpr] ~ ... # 89| getAnOperand/getOperand: [MethodCall] call to bar # 89| getReceiver: [ConstantReadAccess] X # 92| getStmt: [MethodCall] call to foo +# 92| getReceiver: [Self] self # 92| getBlock: [BraceBlock] { ... } # 92| getStmt: [MethodCall] call to bar +# 92| getReceiver: [Self] self # 92| getStmt: [MethodCall] call to baz # 92| getReceiver: [ConstantReadAccess] X # 95| getStmt: [MethodCall] call to foo +# 95| getReceiver: [Self] self # 95| getBlock: [DoBlock] do ... end # 96| getStmt: [MethodCall] call to bar +# 96| getReceiver: [Self] self # 97| getStmt: [MethodCall] call to baz # 97| getReceiver: [ConstantReadAccess] X # 101| getStmt: [MethodCall] call to bar # 101| getReceiver: [MethodCall] call to foo +# 101| getReceiver: [Self] self # 102| getStmt: [MethodCall] call to baz # 102| getReceiver: [MethodCall] call to bar +# 102| getReceiver: [Self] self # 106| getStmt: [CaseExpr] case ... # 106| getValue: [MethodCall] call to foo +# 106| getReceiver: [Self] self # 107| getBranch: [WhenExpr] when ... # 107| getPattern: [MethodCall] call to bar +# 107| getReceiver: [Self] self # 107| getBody: [StmtSequence] then ... # 108| getStmt: [MethodCall] call to baz +# 108| getReceiver: [Self] self # 110| getStmt: [CaseExpr] case ... # 110| getValue: [MethodCall] call to foo # 110| getReceiver: [ConstantReadAccess] X @@ -130,16 +158,20 @@ calls/calls.rb: # 112| getReceiver: [ConstantReadAccess] X # 116| getStmt: [ClassDeclaration] MyClass # 117| getStmt: [MethodCall] call to foo +# 117| getReceiver: [Self] self # 118| getStmt: [MethodCall] call to bar # 118| getReceiver: [ConstantReadAccess] X # 122| getStmt: [ClassDeclaration] MyClass # 122| getSuperclassExpr: [MethodCall] call to foo +# 122| getReceiver: [Self] self # 124| getStmt: [ClassDeclaration] MyClass2 # 124| getSuperclassExpr: [MethodCall] call to foo # 124| getReceiver: [ConstantReadAccess] X # 128| getStmt: [ClassDeclaration] class << ... # 128| getValue: [MethodCall] call to foo +# 128| getReceiver: [Self] self # 129| getStmt: [MethodCall] call to bar +# 129| getReceiver: [Self] self # 131| getStmt: [ClassDeclaration] class << ... # 131| getValue: [MethodCall] call to foo # 131| getReceiver: [ConstantReadAccess] X @@ -147,17 +179,21 @@ calls/calls.rb: # 132| getReceiver: [ConstantReadAccess] X # 136| getStmt: [Method] some_method # 137| getStmt: [MethodCall] call to foo +# 137| getReceiver: [Self] self # 138| getStmt: [MethodCall] call to bar # 138| getReceiver: [ConstantReadAccess] X # 142| getStmt: [SingletonMethod] some_method # 142| getObject: [MethodCall] call to foo +# 142| getReceiver: [Self] self # 143| getStmt: [MethodCall] call to bar +# 143| getReceiver: [Self] self # 144| getStmt: [MethodCall] call to baz # 144| getReceiver: [ConstantReadAccess] X # 148| getStmt: [Method] method_with_keyword_param # 148| getParameter: [KeywordParameter] keyword # 148| getDefiningAccess: [LocalVariableAccess] keyword # 148| getDefaultValue: [MethodCall] call to foo +# 148| getReceiver: [Self] self # 150| getStmt: [Method] method_with_keyword_param2 # 150| getParameter: [KeywordParameter] keyword # 150| getDefiningAccess: [LocalVariableAccess] keyword @@ -167,6 +203,7 @@ calls/calls.rb: # 154| getParameter: [OptionalParameter] param # 154| getDefiningAccess: [LocalVariableAccess] param # 154| getDefaultValue: [MethodCall] call to foo +# 154| getReceiver: [Self] self # 156| getStmt: [Method] method_with_optional_param2 # 156| getParameter: [OptionalParameter] param # 156| getDefiningAccess: [LocalVariableAccess] param @@ -174,12 +211,16 @@ calls/calls.rb: # 156| getReceiver: [ConstantReadAccess] X # 160| getStmt: [ModuleDeclaration] SomeModule # 161| getStmt: [MethodCall] call to foo +# 161| getReceiver: [Self] self # 162| getStmt: [MethodCall] call to bar # 162| getReceiver: [ConstantReadAccess] X # 166| getStmt: [TernaryIfExpr] ... ? ... : ... # 166| getCondition: [MethodCall] call to foo +# 166| getReceiver: [Self] self # 166| getBranch/getThen: [MethodCall] call to bar +# 166| getReceiver: [Self] self # 166| getBranch/getElse: [MethodCall] call to baz +# 166| getReceiver: [Self] self # 167| getStmt: [TernaryIfExpr] ... ? ... : ... # 167| getCondition: [MethodCall] call to foo # 167| getReceiver: [ConstantReadAccess] X @@ -189,14 +230,19 @@ calls/calls.rb: # 167| getReceiver: [ConstantReadAccess] X # 170| getStmt: [IfExpr] if ... # 170| getCondition: [MethodCall] call to foo +# 170| getReceiver: [Self] self # 170| getBranch/getThen: [StmtSequence] then ... # 171| getStmt: [MethodCall] call to wibble +# 171| getReceiver: [Self] self # 172| getBranch/getElse: [IfExpr] elsif ... # 172| getCondition: [MethodCall] call to bar +# 172| getReceiver: [Self] self # 172| getBranch/getThen: [StmtSequence] then ... # 173| getStmt: [MethodCall] call to wobble +# 173| getReceiver: [Self] self # 174| getBranch/getElse: [StmtSequence] else ... # 175| getStmt: [MethodCall] call to wabble +# 175| getReceiver: [Self] self # 177| getStmt: [IfExpr] if ... # 177| getCondition: [MethodCall] call to foo # 177| getReceiver: [ConstantReadAccess] X @@ -214,7 +260,9 @@ calls/calls.rb: # 182| getReceiver: [ConstantReadAccess] X # 186| getStmt: [IfModifierExpr] ... if ... # 186| getBody/getBranch: [MethodCall] call to bar +# 186| getReceiver: [Self] self # 186| getCondition: [MethodCall] call to foo +# 186| getReceiver: [Self] self # 187| getStmt: [IfModifierExpr] ... if ... # 187| getBody/getBranch: [MethodCall] call to bar # 187| getReceiver: [ConstantReadAccess] X @@ -222,8 +270,10 @@ calls/calls.rb: # 187| getReceiver: [ConstantReadAccess] X # 190| getStmt: [UnlessExpr] unless ... # 190| getCondition: [MethodCall] call to foo +# 190| getReceiver: [Self] self # 190| getBranch/getThen: [StmtSequence] then ... # 191| getStmt: [MethodCall] call to bar +# 191| getReceiver: [Self] self # 193| getStmt: [UnlessExpr] unless ... # 193| getCondition: [MethodCall] call to foo # 193| getReceiver: [ConstantReadAccess] X @@ -232,7 +282,9 @@ calls/calls.rb: # 194| getReceiver: [ConstantReadAccess] X # 198| getStmt: [UnlessModifierExpr] ... unless ... # 198| getBody/getBranch: [MethodCall] call to bar +# 198| getReceiver: [Self] self # 198| getCondition: [MethodCall] call to foo +# 198| getReceiver: [Self] self # 199| getStmt: [UnlessModifierExpr] ... unless ... # 199| getBody/getBranch: [MethodCall] call to bar # 199| getReceiver: [ConstantReadAccess] X @@ -240,8 +292,10 @@ calls/calls.rb: # 199| getReceiver: [ConstantReadAccess] X # 202| getStmt: [WhileExpr] while ... # 202| getCondition: [MethodCall] call to foo +# 202| getReceiver: [Self] self # 202| getBody: [StmtSequence] do ... # 203| getStmt: [MethodCall] call to bar +# 203| getReceiver: [Self] self # 205| getStmt: [WhileExpr] while ... # 205| getCondition: [MethodCall] call to foo # 205| getReceiver: [ConstantReadAccess] X @@ -250,7 +304,9 @@ calls/calls.rb: # 206| getReceiver: [ConstantReadAccess] X # 210| getStmt: [WhileModifierExpr] ... while ... # 210| getBody: [MethodCall] call to bar +# 210| getReceiver: [Self] self # 210| getCondition: [MethodCall] call to foo +# 210| getReceiver: [Self] self # 211| getStmt: [WhileModifierExpr] ... while ... # 211| getBody: [MethodCall] call to bar # 211| getReceiver: [ConstantReadAccess] X @@ -258,8 +314,10 @@ calls/calls.rb: # 211| getReceiver: [ConstantReadAccess] X # 214| getStmt: [UntilExpr] until ... # 214| getCondition: [MethodCall] call to foo +# 214| getReceiver: [Self] self # 214| getBody: [StmtSequence] do ... # 215| getStmt: [MethodCall] call to bar +# 215| getReceiver: [Self] self # 217| getStmt: [UntilExpr] until ... # 217| getCondition: [MethodCall] call to foo # 217| getReceiver: [ConstantReadAccess] X @@ -268,7 +326,9 @@ calls/calls.rb: # 218| getReceiver: [ConstantReadAccess] X # 222| getStmt: [UntilModifierExpr] ... until ... # 222| getBody: [MethodCall] call to bar +# 222| getReceiver: [Self] self # 222| getCondition: [MethodCall] call to foo +# 222| getReceiver: [Self] self # 223| getStmt: [UntilModifierExpr] ... until ... # 223| getBody: [MethodCall] call to bar # 223| getReceiver: [ConstantReadAccess] X @@ -278,8 +338,10 @@ calls/calls.rb: # 226| getPattern: [LocalVariableAccess] x # 226| : [???] In # 226| getValue: [MethodCall] call to bar +# 226| getReceiver: [Self] self # 226| getBody: [StmtSequence] do ... # 227| getStmt: [MethodCall] call to baz +# 227| getReceiver: [Self] self # 229| getStmt: [ForExpr] for ... in ... # 229| getPattern: [LocalVariableAccess] x # 229| : [???] In @@ -290,7 +352,9 @@ calls/calls.rb: # 230| getReceiver: [ConstantReadAccess] X # 234| getStmt: [ElementReference] ...[...] # 234| getReceiver: [MethodCall] call to foo +# 234| getReceiver: [Self] self # 234| getArgument: [MethodCall] call to bar +# 234| getReceiver: [Self] self # 235| getStmt: [ElementReference] ...[...] # 235| getReceiver: [MethodCall] call to foo # 235| getReceiver: [ConstantReadAccess] X @@ -300,18 +364,22 @@ calls/calls.rb: # 238| getComponent: [StringTextComponent] foo- # 238| getComponent: [StringInterpolationComponent] #{...} # 238| getStmt: [MethodCall] call to bar +# 238| getReceiver: [Self] self # 238| getComponent: [StringTextComponent] - # 238| getComponent: [StringInterpolationComponent] #{...} # 238| getStmt: [MethodCall] call to baz # 238| getReceiver: [ConstantReadAccess] X # 241| getStmt: [ConstantReadAccess] Bar # 241| getScopeExpr: [MethodCall] call to foo +# 241| getReceiver: [Self] self # 242| getStmt: [ConstantReadAccess] Bar # 242| getScopeExpr: [MethodCall] call to foo # 242| getReceiver: [ConstantReadAccess] X # 245| getStmt: [RangeLiteral] _ .. _ # 245| getBegin: [MethodCall] call to foo +# 245| getReceiver: [Self] self # 245| getEnd: [MethodCall] call to bar +# 245| getReceiver: [Self] self # 246| getStmt: [RangeLiteral] _ .. _ # 246| getBegin: [MethodCall] call to foo # 246| getReceiver: [ConstantReadAccess] X @@ -320,7 +388,9 @@ calls/calls.rb: # 249| getStmt: [HashLiteral] {...} # 249| getElement: [Pair] Pair # 249| getKey: [MethodCall] call to foo +# 249| getReceiver: [Self] self # 249| getValue: [MethodCall] call to bar +# 249| getReceiver: [Self] self # 249| getElement: [Pair] Pair # 249| getKey: [MethodCall] call to foo # 249| getReceiver: [ConstantReadAccess] X @@ -329,8 +399,10 @@ calls/calls.rb: # 252| getStmt: [BeginExpr] begin ... # 253| getRescue: [RescueClause] rescue ... # 253| getException: [MethodCall] call to foo +# 253| getReceiver: [Self] self # 254| getEnsure: [StmtSequence] ensure ... # 254| getStmt: [MethodCall] call to bar +# 254| getReceiver: [Self] self # 256| getStmt: [BeginExpr] begin ... # 257| getRescue: [RescueClause] rescue ... # 257| getException: [MethodCall] call to foo @@ -340,38 +412,52 @@ calls/calls.rb: # 258| getReceiver: [ConstantReadAccess] X # 262| getStmt: [RescueModifierExpr] ... rescue ... # 262| getBody: [MethodCall] call to foo +# 262| getReceiver: [Self] self # 262| getHandler: [MethodCall] call to bar +# 262| getReceiver: [Self] self # 263| getStmt: [RescueModifierExpr] ... rescue ... # 263| getBody: [MethodCall] call to foo # 263| getReceiver: [ConstantReadAccess] X # 263| getHandler: [MethodCall] call to bar # 263| getReceiver: [ConstantReadAccess] X # 266| getStmt: [MethodCall] call to foo +# 266| getReceiver: [Self] self # 266| getArgument: [BlockArgument] &... # 266| getValue: [MethodCall] call to bar +# 266| getReceiver: [Self] self # 267| getStmt: [MethodCall] call to foo +# 267| getReceiver: [Self] self # 267| getArgument: [BlockArgument] &... # 267| getValue: [MethodCall] call to bar # 267| getReceiver: [ConstantReadAccess] X # 270| getStmt: [MethodCall] call to foo +# 270| getReceiver: [Self] self # 270| getArgument: [SplatArgument] *... # 270| getValue: [MethodCall] call to bar +# 270| getReceiver: [Self] self # 271| getStmt: [MethodCall] call to foo +# 271| getReceiver: [Self] self # 271| getArgument: [SplatArgument] *... # 271| getValue: [MethodCall] call to bar # 271| getReceiver: [ConstantReadAccess] X # 274| getStmt: [MethodCall] call to foo +# 274| getReceiver: [Self] self # 274| getArgument: [HashSplatArgument] **... # 274| getValue: [MethodCall] call to bar +# 274| getReceiver: [Self] self # 275| getStmt: [MethodCall] call to foo +# 275| getReceiver: [Self] self # 275| getArgument: [HashSplatArgument] **... # 275| getValue: [MethodCall] call to bar # 275| getReceiver: [ConstantReadAccess] X # 278| getStmt: [MethodCall] call to foo +# 278| getReceiver: [Self] self # 278| getArgument: [Pair] Pair # 278| getKey: [SymbolLiteral] :blah # 278| getValue: [MethodCall] call to bar +# 278| getReceiver: [Self] self # 279| getStmt: [MethodCall] call to foo +# 279| getReceiver: [Self] self # 279| getArgument: [Pair] Pair # 279| getKey: [SymbolLiteral] :blah # 279| getValue: [MethodCall] call to bar @@ -423,14 +509,17 @@ calls/calls.rb: # 302| getStmt: [Method] another_method # 303| getStmt: [MethodCall] call to super # 303| getReceiver: [MethodCall] call to foo +# 303| getReceiver: [Self] self # 304| getStmt: [MethodCall] call to super # 304| getReceiver: [Self] self # 305| getStmt: [MethodCall] call to super # 305| getReceiver: [SuperCall] call to super # 310| getStmt: [MethodCall] call to call # 310| getReceiver: [MethodCall] call to foo +# 310| getReceiver: [Self] self # 311| getStmt: [MethodCall] call to call # 311| getReceiver: [MethodCall] call to foo +# 311| getReceiver: [Self] self # 311| getArgument: [IntegerLiteral] 1 # 314| getStmt: [AssignExpr] ... = ... # 314| getAnOperand/getLeftOperand: [SetterMethodCall] call to foo= @@ -439,6 +528,7 @@ calls/calls.rb: # 315| getStmt: [AssignExpr] ... = ... # 315| getAnOperand/getLeftOperand: [ElementReference, SetterMethodCall] ...[...] # 315| getReceiver: [MethodCall] call to foo +# 315| getReceiver: [Self] self # 315| getArgument: [IntegerLiteral] 0 # 315| getAnOperand/getRightOperand: [IntegerLiteral] 10 # 316| getStmt: [AssignExpr] ... = ... @@ -449,6 +539,7 @@ calls/calls.rb: # 316| getReceiver: [Self] self # 316| getElement: [ElementReference, SetterMethodCall] ...[...] # 316| getReceiver: [MethodCall] call to foo +# 316| getReceiver: [Self] self # 316| getArgument: [IntegerLiteral] 4 # 316| getAnOperand/getRightOperand: [ArrayLiteral] [...] # 316| getElement: [IntegerLiteral] 1 @@ -460,6 +551,7 @@ calls/calls.rb: # 317| getElement: [LocalVariableAccess] a # 317| getElement: [ElementReference, SetterMethodCall] ...[...] # 317| getReceiver: [MethodCall] call to foo +# 317| getReceiver: [Self] self # 317| getArgument: [IntegerLiteral] 5 # 317| getAnOperand/getRightOperand: [ArrayLiteral] [...] # 317| getElement: [IntegerLiteral] 1 @@ -472,6 +564,7 @@ calls/calls.rb: # 319| getStmt: [AssignAddExpr] ... += ... # 319| getAnOperand/getLeftOperand: [ElementReference, SetterMethodCall] ...[...] # 319| getReceiver: [MethodCall] call to foo +# 319| getReceiver: [Self] self # 319| getArgument: [IntegerLiteral] 0 # 319| getAnOperand/getRightOperand: [IntegerLiteral] 1 control/cases.rb: @@ -527,6 +620,7 @@ modules/classes.rb: # 7| getSuperclassExpr: [ConstantReadAccess] BaseClass # 11| getStmt: [ClassDeclaration] Baz # 11| getSuperclassExpr: [MethodCall] call to superclass_for +# 11| getReceiver: [Self] self # 11| getArgument: [SymbolLiteral] :baz # 15| getStmt: [ModuleDeclaration] MyModule # 16| getStmt: [ClassDeclaration] MyClass @@ -534,13 +628,16 @@ modules/classes.rb: # 20| getStmt: [ClassDeclaration] Wibble # 21| getStmt: [Method] method_a # 22| getStmt: [MethodCall] call to puts +# 22| getReceiver: [Self] self # 22| getArgument: [StringLiteral] "a" # 22| getComponent: [StringTextComponent] a # 25| getStmt: [Method] method_b # 26| getStmt: [MethodCall] call to puts +# 26| getReceiver: [Self] self # 26| getArgument: [StringLiteral] "b" # 26| getComponent: [StringTextComponent] b # 29| getStmt: [MethodCall] call to some_method_call +# 29| getReceiver: [Self] self # 30| getStmt: [AssignExpr] ... = ... # 30| getAnOperand/getLeftOperand: [GlobalVariableAccess] $global_var # 30| getAnOperand/getRightOperand: [IntegerLiteral] 123 @@ -558,9 +655,11 @@ modules/classes.rb: # 43| getAnOperand/getRightOperand: [SuperCall] call to super # 46| getStmt: [Method] wibble # 47| getStmt: [MethodCall] call to puts +# 47| getReceiver: [Self] self # 47| getArgument: [StringLiteral] "wibble" # 47| getComponent: [StringTextComponent] wibble # 50| getStmt: [MethodCall] call to another_method_call +# 50| getReceiver: [Self] self # 51| getStmt: [AssignExpr] ... = ... # 51| getAnOperand/getLeftOperand: [GlobalVariableAccess] $global_var2 # 51| getAnOperand/getRightOperand: [IntegerLiteral] 456 @@ -716,6 +815,7 @@ constants/constants.rb: # 19| getParameter: [SimpleParameter] name # 19| getDefiningAccess: [LocalVariableAccess] name # 20| getStmt: [MethodCall] call to puts +# 20| getReceiver: [Self] self # 20| getArgument: [StringLiteral] "#{...} #{...}" # 20| getComponent: [StringInterpolationComponent] #{...} # 20| getStmt: [ConstantReadAccess] GREETING @@ -723,6 +823,7 @@ constants/constants.rb: # 20| getComponent: [StringInterpolationComponent] #{...} # 20| getStmt: [LocalVariableAccess] name # 25| getStmt: [MethodCall] call to Array +# 25| getReceiver: [Self] self # 25| getArgument: [StringLiteral] "foo" # 25| getComponent: [StringTextComponent] foo # 28| getStmt: [ClassDeclaration] ClassD @@ -842,6 +943,7 @@ literals/literals.rb: # 66| getComponent: [StringTextComponent] foo # 66| getComponent: [StringInterpolationComponent] #{...} # 66| getStmt: [MethodCall] call to blah +# 66| getReceiver: [Self] self # 66| getStmt: [AddExpr] ... + ... # 66| getAnOperand/getLeftOperand: [IntegerLiteral] 1 # 66| getAnOperand/getRightOperand: [IntegerLiteral] 9 @@ -987,6 +1089,7 @@ literals/literals.rb: # 114| getValue: [IntegerLiteral] 7 # 114| getElement: [HashSplatArgument] **... # 114| getValue: [MethodCall] call to bar +# 114| getReceiver: [Self] self # 117| getStmt: [ParenthesizedExpr] ( ... ) # 117| getStmt: [RangeLiteral] _ .. _ # 117| getBegin: [IntegerLiteral] 1 @@ -1002,6 +1105,7 @@ literals/literals.rb: # 120| getStmt: [ParenthesizedExpr] ( ... ) # 120| getStmt: [RangeLiteral] _ .. _ # 120| getBegin: [MethodCall] call to start +# 120| getReceiver: [Self] self # 120| getEnd: [AddExpr] ... + ... # 120| getAnOperand/getLeftOperand: [IntegerLiteral] 2 # 120| getAnOperand/getRightOperand: [IntegerLiteral] 3 @@ -1085,6 +1189,7 @@ literals/literals.rb: # 148| getComponent: [StringEscapeSequenceComponent] \\ # 148| getComponent: [StringTextComponent] foobar # 151| getStmt: [MethodCall] call to run_sql +# 151| getReceiver: [Self] self # 151| getArgument: [HereDoc] < #{...}" # 10| getComponent: [StringInterpolationComponent] #{...} # 10| getStmt: [LocalVariableAccess] key @@ -1652,6 +1770,7 @@ params/params.rb: # 22| getElement: [LocalVariableAccess] a # 22| getElement: [LocalVariableAccess] b # 22| getStmt: [MethodCall] call to puts +# 22| getReceiver: [Self] self # 22| getArgument: [AddExpr] ... + ... # 22| getAnOperand/getLeftOperand: [LocalVariableAccess] a # 22| getAnOperand/getRightOperand: [LocalVariableAccess] b @@ -1713,6 +1832,7 @@ params/params.rb: # 46| getParameter: [BlockParameter] &block # 46| getDefiningAccess: [LocalVariableAccess] block # 47| getStmt: [MethodCall] call to puts +# 47| getReceiver: [Self] self # 47| getArgument: [MethodCall] call to call # 47| getReceiver: [LocalVariableAccess] block # 47| getArgument: [Pair] Pair @@ -1722,6 +1842,7 @@ params/params.rb: # 47| getKey: [SymbolLiteral] :foo # 47| getValue: [IntegerLiteral] 3 # 49| getStmt: [MethodCall] call to use_block_with_keyword +# 49| getReceiver: [Self] self # 49| getBlock: [DoBlock] do ... end # 49| getParameter: [KeywordParameter] xx # 49| getDefiningAccess: [LocalVariableAccess] xx @@ -1763,6 +1884,7 @@ params/params.rb: # 63| getArgument: [StringLiteral] "Zeus" # 63| getComponent: [StringTextComponent] Zeus # 65| getStmt: [MethodCall] call to use_block_with_optional +# 65| getReceiver: [Self] self # 65| getBlock: [DoBlock] do ... end # 65| getParameter: [SimpleParameter] name # 65| getDefiningAccess: [LocalVariableAccess] name @@ -1770,6 +1892,7 @@ params/params.rb: # 65| getDefiningAccess: [LocalVariableAccess] age # 65| getDefaultValue: [IntegerLiteral] 99 # 66| getStmt: [MethodCall] call to puts +# 66| getReceiver: [Self] self # 66| getArgument: [StringLiteral] "#{...} is #{...} years old" # 66| getComponent: [StringInterpolationComponent] #{...} # 66| getStmt: [LocalVariableAccess] name @@ -1796,13 +1919,16 @@ params/params.rb: modules/toplevel.rb: # 1| [Toplevel] toplevel.rb # 1| getStmt: [MethodCall] call to puts +# 1| getReceiver: [Self] self # 1| getArgument: [StringLiteral] "world" # 1| getComponent: [StringTextComponent] world # 3| getStmt: [EndBlock] END { ... } # 3| getStmt: [MethodCall] call to puts +# 3| getReceiver: [Self] self # 3| getArgument: [StringLiteral] "!!!" # 3| getComponent: [StringTextComponent] !!! # 5| getBeginBlock: [BeginBlock] BEGIN { ... } # 5| getStmt: [MethodCall] call to puts +# 5| getReceiver: [Self] self # 5| getArgument: [StringLiteral] "hello" # 5| getComponent: [StringTextComponent] hello diff --git a/ql/test/library-tests/ast/calls/calls.expected b/ql/test/library-tests/ast/calls/calls.expected index 98003a98822..74bcfee07ed 100644 --- a/ql/test/library-tests/ast/calls/calls.expected +++ b/ql/test/library-tests/ast/calls/calls.expected @@ -1,86 +1,8 @@ callsWithNoReceiverArgumentsOrBlock -| calls.rb:2:1:2:5 | call to foo | foo | -| calls.rb:8:1:8:7 | call to bar | bar | | calls.rb:31:3:31:7 | yield ... | (none) | -| calls.rb:46:1:46:3 | call to foo | foo | -| calls.rb:50:2:50:4 | call to foo | foo | -| calls.rb:54:11:54:13 | call to foo | foo | -| calls.rb:58:2:58:4 | call to foo | foo | -| calls.rb:62:8:62:10 | call to foo | foo | -| calls.rb:66:9:66:11 | call to bar | bar | -| calls.rb:70:8:70:10 | call to foo | foo | -| calls.rb:74:3:74:5 | call to foo | foo | -| calls.rb:79:9:79:11 | call to foo | foo | -| calls.rb:82:7:82:9 | call to foo | foo | -| calls.rb:85:1:85:3 | call to foo | foo | -| calls.rb:88:2:88:4 | call to foo | foo | -| calls.rb:92:9:92:11 | call to bar | bar | -| calls.rb:96:3:96:5 | call to bar | bar | -| calls.rb:101:1:101:3 | call to foo | foo | -| calls.rb:102:1:102:3 | call to bar | bar | -| calls.rb:106:6:106:8 | call to foo | foo | -| calls.rb:107:6:107:8 | call to bar | bar | -| calls.rb:108:3:108:5 | call to baz | baz | -| calls.rb:117:3:117:5 | call to foo | foo | -| calls.rb:122:17:122:19 | call to foo | foo | -| calls.rb:128:10:128:12 | call to foo | foo | -| calls.rb:129:3:129:5 | call to bar | bar | -| calls.rb:137:3:137:5 | call to foo | foo | -| calls.rb:142:5:142:7 | call to foo | foo | -| calls.rb:143:3:143:5 | call to bar | bar | -| calls.rb:148:40:148:42 | call to foo | foo | -| calls.rb:154:40:154:42 | call to foo | foo | -| calls.rb:161:3:161:5 | call to foo | foo | -| calls.rb:166:1:166:3 | call to foo | foo | -| calls.rb:166:7:166:9 | call to bar | bar | -| calls.rb:166:13:166:15 | call to baz | baz | -| calls.rb:170:4:170:6 | call to foo | foo | -| calls.rb:171:3:171:8 | call to wibble | wibble | -| calls.rb:172:7:172:9 | call to bar | bar | -| calls.rb:173:3:173:8 | call to wobble | wobble | -| calls.rb:175:3:175:8 | call to wabble | wabble | -| calls.rb:186:1:186:3 | call to bar | bar | -| calls.rb:186:8:186:10 | call to foo | foo | -| calls.rb:190:8:190:10 | call to foo | foo | -| calls.rb:191:3:191:5 | call to bar | bar | -| calls.rb:198:1:198:3 | call to bar | bar | -| calls.rb:198:12:198:14 | call to foo | foo | -| calls.rb:202:7:202:9 | call to foo | foo | -| calls.rb:203:3:203:5 | call to bar | bar | -| calls.rb:210:1:210:3 | call to bar | bar | -| calls.rb:210:11:210:13 | call to foo | foo | -| calls.rb:214:7:214:9 | call to foo | foo | -| calls.rb:215:3:215:5 | call to bar | bar | -| calls.rb:222:1:222:3 | call to bar | bar | -| calls.rb:222:11:222:13 | call to foo | foo | -| calls.rb:226:10:226:12 | call to bar | bar | -| calls.rb:227:3:227:5 | call to baz | baz | -| calls.rb:234:1:234:3 | call to foo | foo | -| calls.rb:234:5:234:7 | call to bar | bar | -| calls.rb:238:8:238:10 | call to bar | bar | -| calls.rb:241:1:241:3 | call to foo | foo | -| calls.rb:245:1:245:3 | call to foo | foo | -| calls.rb:245:6:245:8 | call to bar | bar | -| calls.rb:249:3:249:5 | call to foo | foo | -| calls.rb:249:10:249:12 | call to bar | bar | -| calls.rb:253:8:253:10 | call to foo | foo | -| calls.rb:254:8:254:10 | call to bar | bar | -| calls.rb:262:1:262:3 | call to foo | foo | -| calls.rb:262:12:262:14 | call to bar | bar | -| calls.rb:266:6:266:8 | call to bar | bar | -| calls.rb:270:6:270:8 | call to bar | bar | -| calls.rb:274:7:274:9 | call to bar | bar | -| calls.rb:278:11:278:13 | call to bar | bar | | calls.rb:286:5:286:9 | call to super | super | | calls.rb:287:5:287:11 | call to super | super | -| calls.rb:303:5:303:7 | call to foo | foo | | calls.rb:305:5:305:9 | call to super | super | -| calls.rb:310:1:310:3 | call to foo | foo | -| calls.rb:311:1:311:3 | call to foo | foo | -| calls.rb:315:1:315:3 | call to foo | foo | -| calls.rb:316:22:316:24 | call to foo | foo | -| calls.rb:317:5:317:7 | call to foo | foo | -| calls.rb:319:1:319:3 | call to foo | foo | callsWithArguments | calls.rb:14:1:14:11 | call to foo | foo | 0 | calls.rb:14:5:14:5 | 0 | | calls.rb:14:1:14:11 | call to foo | foo | 1 | calls.rb:14:8:14:8 | 1 | @@ -115,91 +37,184 @@ callsWithArguments | calls.rb:319:1:319:6 | ...[...] | [] | 0 | calls.rb:319:5:319:5 | 0 | | calls.rb:319:1:319:6 | ...[...] | []= | 0 | calls.rb:319:5:319:5 | 0 | callsWithReceiver +| calls.rb:2:1:2:5 | call to foo | calls.rb:2:1:2:5 | self | | calls.rb:5:1:5:10 | call to bar | calls.rb:5:1:5:3 | Foo | +| calls.rb:8:1:8:7 | call to bar | calls.rb:8:1:8:7 | self | | calls.rb:11:1:11:7 | call to bar | calls.rb:11:1:11:3 | 123 | +| calls.rb:14:1:14:11 | call to foo | calls.rb:14:1:14:11 | self | +| calls.rb:17:1:17:17 | call to foo | calls.rb:17:1:17:17 | self | +| calls.rb:20:1:22:3 | call to foo | calls.rb:20:1:22:3 | self | | calls.rb:25:1:27:3 | call to bar | calls.rb:25:1:25:3 | 123 | +| calls.rb:46:1:46:3 | call to foo | calls.rb:46:1:46:3 | self | | calls.rb:47:1:47:6 | call to foo | calls.rb:47:1:47:1 | X | +| calls.rb:50:2:50:4 | call to foo | calls.rb:50:2:50:4 | self | | calls.rb:51:2:51:7 | call to foo | calls.rb:51:2:51:2 | X | +| calls.rb:54:1:54:14 | call to some_func | calls.rb:54:1:54:14 | self | +| calls.rb:54:11:54:13 | call to foo | calls.rb:54:11:54:13 | self | +| calls.rb:55:1:55:17 | call to some_func | calls.rb:55:1:55:17 | self | | calls.rb:55:11:55:16 | call to foo | calls.rb:55:11:55:11 | X | +| calls.rb:58:2:58:4 | call to foo | calls.rb:58:2:58:4 | self | | calls.rb:59:2:59:7 | call to foo | calls.rb:59:2:59:2 | X | +| calls.rb:62:8:62:10 | call to foo | calls.rb:62:8:62:10 | self | | calls.rb:63:8:63:13 | call to foo | calls.rb:63:8:63:8 | X | +| calls.rb:66:9:66:11 | call to bar | calls.rb:66:9:66:11 | self | | calls.rb:67:9:67:14 | call to bar | calls.rb:67:9:67:9 | X | +| calls.rb:70:8:70:10 | call to foo | calls.rb:70:8:70:10 | self | | calls.rb:70:13:70:18 | call to bar | calls.rb:70:13:70:13 | X | +| calls.rb:74:3:74:5 | call to foo | calls.rb:74:3:74:5 | self | | calls.rb:75:3:75:8 | call to foo | calls.rb:75:3:75:3 | X | +| calls.rb:79:9:79:11 | call to foo | calls.rb:79:9:79:11 | self | | calls.rb:79:14:79:19 | call to bar | calls.rb:79:14:79:14 | X | +| calls.rb:82:7:82:9 | call to foo | calls.rb:82:7:82:9 | self | | calls.rb:82:12:82:17 | call to bar | calls.rb:82:12:82:12 | X | +| calls.rb:85:1:85:3 | call to foo | calls.rb:85:1:85:3 | self | | calls.rb:85:7:85:12 | call to bar | calls.rb:85:7:85:7 | X | +| calls.rb:88:2:88:4 | call to foo | calls.rb:88:2:88:4 | self | | calls.rb:89:2:89:7 | call to bar | calls.rb:89:2:89:2 | X | +| calls.rb:92:1:92:21 | call to foo | calls.rb:92:1:92:21 | self | +| calls.rb:92:9:92:11 | call to bar | calls.rb:92:9:92:11 | self | | calls.rb:92:14:92:19 | call to baz | calls.rb:92:14:92:14 | X | +| calls.rb:95:1:98:3 | call to foo | calls.rb:95:1:98:3 | self | +| calls.rb:96:3:96:5 | call to bar | calls.rb:96:3:96:5 | self | | calls.rb:97:3:97:8 | call to baz | calls.rb:97:3:97:3 | X | +| calls.rb:101:1:101:3 | call to foo | calls.rb:101:1:101:3 | self | | calls.rb:101:1:101:9 | call to bar | calls.rb:101:1:101:3 | call to foo | +| calls.rb:102:1:102:3 | call to bar | calls.rb:102:1:102:3 | self | | calls.rb:102:1:102:9 | call to baz | calls.rb:102:1:102:3 | call to bar | +| calls.rb:106:6:106:8 | call to foo | calls.rb:106:6:106:8 | self | +| calls.rb:107:6:107:8 | call to bar | calls.rb:107:6:107:8 | self | +| calls.rb:108:3:108:5 | call to baz | calls.rb:108:3:108:5 | self | | calls.rb:110:6:110:11 | call to foo | calls.rb:110:6:110:6 | X | | calls.rb:111:6:111:11 | call to bar | calls.rb:111:6:111:6 | X | | calls.rb:112:3:112:8 | call to baz | calls.rb:112:3:112:3 | X | +| calls.rb:117:3:117:5 | call to foo | calls.rb:117:3:117:5 | self | | calls.rb:118:3:118:8 | call to bar | calls.rb:118:3:118:3 | X | +| calls.rb:122:17:122:19 | call to foo | calls.rb:122:17:122:19 | self | | calls.rb:124:18:124:23 | call to foo | calls.rb:124:18:124:18 | X | +| calls.rb:128:10:128:12 | call to foo | calls.rb:128:10:128:12 | self | +| calls.rb:129:3:129:5 | call to bar | calls.rb:129:3:129:5 | self | | calls.rb:131:10:131:15 | call to foo | calls.rb:131:10:131:10 | X | | calls.rb:132:3:132:8 | call to bar | calls.rb:132:3:132:3 | X | +| calls.rb:137:3:137:5 | call to foo | calls.rb:137:3:137:5 | self | | calls.rb:138:3:138:8 | call to bar | calls.rb:138:3:138:3 | X | +| calls.rb:142:5:142:7 | call to foo | calls.rb:142:5:142:7 | self | +| calls.rb:143:3:143:5 | call to bar | calls.rb:143:3:143:5 | self | | calls.rb:144:3:144:8 | call to baz | calls.rb:144:3:144:3 | X | +| calls.rb:148:40:148:42 | call to foo | calls.rb:148:40:148:42 | self | | calls.rb:150:41:150:46 | call to foo | calls.rb:150:41:150:41 | X | +| calls.rb:154:40:154:42 | call to foo | calls.rb:154:40:154:42 | self | | calls.rb:156:41:156:46 | call to foo | calls.rb:156:41:156:41 | X | +| calls.rb:161:3:161:5 | call to foo | calls.rb:161:3:161:5 | self | | calls.rb:162:3:162:8 | call to bar | calls.rb:162:3:162:3 | X | +| calls.rb:166:1:166:3 | call to foo | calls.rb:166:1:166:3 | self | +| calls.rb:166:7:166:9 | call to bar | calls.rb:166:7:166:9 | self | +| calls.rb:166:13:166:15 | call to baz | calls.rb:166:13:166:15 | self | | calls.rb:167:1:167:6 | call to foo | calls.rb:167:1:167:1 | X | | calls.rb:167:10:167:15 | call to bar | calls.rb:167:10:167:10 | X | | calls.rb:167:19:167:24 | call to baz | calls.rb:167:19:167:19 | X | +| calls.rb:170:4:170:6 | call to foo | calls.rb:170:4:170:6 | self | +| calls.rb:171:3:171:8 | call to wibble | calls.rb:171:3:171:8 | self | +| calls.rb:172:7:172:9 | call to bar | calls.rb:172:7:172:9 | self | +| calls.rb:173:3:173:8 | call to wobble | calls.rb:173:3:173:8 | self | +| calls.rb:175:3:175:8 | call to wabble | calls.rb:175:3:175:8 | self | | calls.rb:177:4:177:9 | call to foo | calls.rb:177:4:177:4 | X | | calls.rb:178:3:178:11 | call to wibble | calls.rb:178:3:178:3 | X | | calls.rb:179:7:179:12 | call to bar | calls.rb:179:7:179:7 | X | | calls.rb:180:3:180:11 | call to wobble | calls.rb:180:3:180:3 | X | | calls.rb:182:3:182:11 | call to wabble | calls.rb:182:3:182:3 | X | +| calls.rb:186:1:186:3 | call to bar | calls.rb:186:1:186:3 | self | +| calls.rb:186:8:186:10 | call to foo | calls.rb:186:8:186:10 | self | | calls.rb:187:1:187:6 | call to bar | calls.rb:187:1:187:1 | X | | calls.rb:187:11:187:16 | call to foo | calls.rb:187:11:187:11 | X | +| calls.rb:190:8:190:10 | call to foo | calls.rb:190:8:190:10 | self | +| calls.rb:191:3:191:5 | call to bar | calls.rb:191:3:191:5 | self | | calls.rb:193:8:193:13 | call to foo | calls.rb:193:8:193:8 | X | | calls.rb:194:3:194:8 | call to bar | calls.rb:194:3:194:3 | X | +| calls.rb:198:1:198:3 | call to bar | calls.rb:198:1:198:3 | self | +| calls.rb:198:12:198:14 | call to foo | calls.rb:198:12:198:14 | self | | calls.rb:199:1:199:6 | call to bar | calls.rb:199:1:199:1 | X | | calls.rb:199:15:199:20 | call to foo | calls.rb:199:15:199:15 | X | +| calls.rb:202:7:202:9 | call to foo | calls.rb:202:7:202:9 | self | +| calls.rb:203:3:203:5 | call to bar | calls.rb:203:3:203:5 | self | | calls.rb:205:7:205:12 | call to foo | calls.rb:205:7:205:7 | X | | calls.rb:206:3:206:8 | call to bar | calls.rb:206:3:206:3 | X | +| calls.rb:210:1:210:3 | call to bar | calls.rb:210:1:210:3 | self | +| calls.rb:210:11:210:13 | call to foo | calls.rb:210:11:210:13 | self | | calls.rb:211:1:211:6 | call to bar | calls.rb:211:1:211:1 | X | | calls.rb:211:14:211:19 | call to foo | calls.rb:211:14:211:14 | X | +| calls.rb:214:7:214:9 | call to foo | calls.rb:214:7:214:9 | self | +| calls.rb:215:3:215:5 | call to bar | calls.rb:215:3:215:5 | self | | calls.rb:217:7:217:12 | call to foo | calls.rb:217:7:217:7 | X | | calls.rb:218:3:218:8 | call to bar | calls.rb:218:3:218:3 | X | +| calls.rb:222:1:222:3 | call to bar | calls.rb:222:1:222:3 | self | +| calls.rb:222:11:222:13 | call to foo | calls.rb:222:11:222:13 | self | | calls.rb:223:1:223:6 | call to bar | calls.rb:223:1:223:1 | X | | calls.rb:223:14:223:19 | call to foo | calls.rb:223:14:223:14 | X | +| calls.rb:226:10:226:12 | call to bar | calls.rb:226:10:226:12 | self | +| calls.rb:227:3:227:5 | call to baz | calls.rb:227:3:227:5 | self | | calls.rb:229:10:229:15 | call to bar | calls.rb:229:10:229:10 | X | | calls.rb:230:3:230:8 | call to baz | calls.rb:230:3:230:3 | X | +| calls.rb:234:1:234:3 | call to foo | calls.rb:234:1:234:3 | self | | calls.rb:234:1:234:8 | ...[...] | calls.rb:234:1:234:3 | call to foo | +| calls.rb:234:5:234:7 | call to bar | calls.rb:234:5:234:7 | self | | calls.rb:235:1:235:6 | call to foo | calls.rb:235:1:235:1 | X | | calls.rb:235:1:235:14 | ...[...] | calls.rb:235:1:235:6 | call to foo | | calls.rb:235:8:235:13 | call to bar | calls.rb:235:8:235:8 | X | +| calls.rb:238:8:238:10 | call to bar | calls.rb:238:8:238:10 | self | | calls.rb:238:15:238:20 | call to baz | calls.rb:238:15:238:15 | X | +| calls.rb:241:1:241:3 | call to foo | calls.rb:241:1:241:3 | self | | calls.rb:242:1:242:6 | call to foo | calls.rb:242:1:242:1 | X | +| calls.rb:245:1:245:3 | call to foo | calls.rb:245:1:245:3 | self | +| calls.rb:245:6:245:8 | call to bar | calls.rb:245:6:245:8 | self | | calls.rb:246:1:246:6 | call to foo | calls.rb:246:1:246:1 | X | | calls.rb:246:9:246:14 | call to bar | calls.rb:246:9:246:9 | X | +| calls.rb:249:3:249:5 | call to foo | calls.rb:249:3:249:5 | self | +| calls.rb:249:10:249:12 | call to bar | calls.rb:249:10:249:12 | self | | calls.rb:249:15:249:20 | call to foo | calls.rb:249:15:249:15 | X | | calls.rb:249:25:249:30 | call to bar | calls.rb:249:25:249:25 | X | +| calls.rb:253:8:253:10 | call to foo | calls.rb:253:8:253:10 | self | +| calls.rb:254:8:254:10 | call to bar | calls.rb:254:8:254:10 | self | | calls.rb:257:8:257:13 | call to foo | calls.rb:257:8:257:8 | X | | calls.rb:258:8:258:13 | call to bar | calls.rb:258:8:258:8 | X | +| calls.rb:262:1:262:3 | call to foo | calls.rb:262:1:262:3 | self | +| calls.rb:262:12:262:14 | call to bar | calls.rb:262:12:262:14 | self | | calls.rb:263:1:263:6 | call to foo | calls.rb:263:1:263:1 | X | | calls.rb:263:15:263:20 | call to bar | calls.rb:263:15:263:15 | X | +| calls.rb:266:1:266:9 | call to foo | calls.rb:266:1:266:9 | self | +| calls.rb:266:6:266:8 | call to bar | calls.rb:266:6:266:8 | self | +| calls.rb:267:1:267:12 | call to foo | calls.rb:267:1:267:12 | self | | calls.rb:267:6:267:11 | call to bar | calls.rb:267:6:267:6 | X | +| calls.rb:270:1:270:9 | call to foo | calls.rb:270:1:270:9 | self | +| calls.rb:270:6:270:8 | call to bar | calls.rb:270:6:270:8 | self | +| calls.rb:271:1:271:12 | call to foo | calls.rb:271:1:271:12 | self | | calls.rb:271:6:271:11 | call to bar | calls.rb:271:6:271:6 | X | +| calls.rb:274:1:274:10 | call to foo | calls.rb:274:1:274:10 | self | +| calls.rb:274:7:274:9 | call to bar | calls.rb:274:7:274:9 | self | +| calls.rb:275:1:275:13 | call to foo | calls.rb:275:1:275:13 | self | | calls.rb:275:7:275:12 | call to bar | calls.rb:275:7:275:7 | X | +| calls.rb:278:1:278:14 | call to foo | calls.rb:278:1:278:14 | self | +| calls.rb:278:11:278:13 | call to bar | calls.rb:278:11:278:13 | self | +| calls.rb:279:1:279:17 | call to foo | calls.rb:279:1:279:17 | self | | calls.rb:279:11:279:16 | call to bar | calls.rb:279:11:279:11 | X | +| calls.rb:303:5:303:7 | call to foo | calls.rb:303:5:303:7 | self | | calls.rb:303:5:303:13 | call to super | calls.rb:303:5:303:7 | call to foo | | calls.rb:304:5:304:14 | call to super | calls.rb:304:5:304:8 | self | | calls.rb:305:5:305:15 | call to super | calls.rb:305:5:305:9 | call to super | +| calls.rb:310:1:310:3 | call to foo | calls.rb:310:1:310:3 | self | | calls.rb:310:1:310:6 | call to call | calls.rb:310:1:310:3 | call to foo | +| calls.rb:311:1:311:3 | call to foo | calls.rb:311:1:311:3 | self | | calls.rb:311:1:311:7 | call to call | calls.rb:311:1:311:3 | call to foo | | calls.rb:314:1:314:8 | call to foo= | calls.rb:314:1:314:4 | self | +| calls.rb:315:1:315:3 | call to foo | calls.rb:315:1:315:3 | self | | calls.rb:315:1:315:6 | ...[...] | calls.rb:315:1:315:3 | call to foo | | calls.rb:316:1:316:8 | call to foo= | calls.rb:316:1:316:4 | self | | calls.rb:316:12:316:19 | call to bar= | calls.rb:316:12:316:15 | self | +| calls.rb:316:22:316:24 | call to foo | calls.rb:316:22:316:24 | self | | calls.rb:316:22:316:27 | ...[...] | calls.rb:316:22:316:24 | call to foo | +| calls.rb:317:5:317:7 | call to foo | calls.rb:317:5:317:7 | self | | calls.rb:317:5:317:10 | ...[...] | calls.rb:317:5:317:7 | call to foo | | calls.rb:318:1:318:10 | call to count/count= | calls.rb:318:1:318:4 | self | +| calls.rb:319:1:319:3 | call to foo | calls.rb:319:1:319:3 | self | | calls.rb:319:1:319:6 | ...[...] | calls.rb:319:1:319:3 | call to foo | callsWithBlock | calls.rb:17:1:17:17 | call to foo | calls.rb:17:5:17:17 | { ... } | diff --git a/ql/test/library-tests/controlflow/graph/Cfg.expected b/ql/test/library-tests/controlflow/graph/Cfg.expected index d4f66c8e830..e7536829476 100644 --- a/ql/test/library-tests/controlflow/graph/Cfg.expected +++ b/ql/test/library-tests/controlflow/graph/Cfg.expected @@ -70,6 +70,9 @@ break_ensure.rb: #-----| -> call to nil? # 8| then ... +#-----| -> self + +# 9| self #-----| -> "elements nil" # 9| call to puts @@ -154,9 +157,15 @@ break_ensure.rb: #-----| -> [ensure: break] call to nil? # 20| then ... -#-----| -> "elements nil" +#-----| -> self # 20| [ensure: break] then ... +#-----| -> [ensure: break] self + +# 21| self +#-----| -> "elements nil" + +# 21| [ensure: break] self #-----| -> [ensure: break] "elements nil" # 21| call to puts @@ -208,7 +217,7 @@ break_ensure.rb: #-----| -> [ensure: return] elements # 33| for ... in ... -#-----| -> "Done" +#-----| -> self # 33| [ensure: return] for ... in ... #-----| return -> exit m3 (normal) @@ -234,10 +243,10 @@ break_ensure.rb: #-----| -> [ensure: return] In # 33| do ... -#-----| -> call to x +#-----| -> self # 33| [ensure: return] do ... -#-----| -> [ensure: return] call to x +#-----| -> [ensure: return] self # 35| if ... #-----| -> In @@ -253,6 +262,12 @@ break_ensure.rb: #-----| true -> [ensure: return] then ... #-----| false -> [ensure: return] if ... +# 35| self +#-----| -> call to x + +# 35| [ensure: return] self +#-----| -> [ensure: return] call to x + # 35| call to x #-----| -> 0 @@ -277,6 +292,9 @@ break_ensure.rb: # 36| [ensure: return] break #-----| break -> [ensure: return] for ... in ... +# 41| self +#-----| -> "Done" + # 41| call to puts #-----| -> exit m3 (normal) @@ -327,6 +345,9 @@ break_ensure.rb: #-----| -> ... > ... # 47| then ... +#-----| -> self + +# 48| self #-----| -> "" # 48| call to raise @@ -406,6 +427,9 @@ case.rb: #-----| -> exit case.rb # 2| case ... +#-----| -> self + +# 2| self #-----| -> call to x1 # 2| call to x1 @@ -419,7 +443,7 @@ case.rb: #-----| no-match -> when ... # 3| then ... -#-----| -> call to x2 +#-----| -> self # 3| ( ... ) #-----| -> exit if_in_case (normal) @@ -427,11 +451,17 @@ case.rb: # 3| if ... #-----| -> ( ... ) +# 3| self +#-----| -> call to x2 + # 3| call to x2 #-----| true -> then ... #-----| false -> if ... # 3| then ... +#-----| -> self + +# 3| self #-----| -> "x2" # 3| call to puts @@ -448,6 +478,9 @@ case.rb: #-----| no-match -> exit if_in_case (normal) # 4| then ... +#-----| -> self + +# 4| self #-----| -> "2" # 4| call to puts @@ -502,7 +535,7 @@ cfg.rb: #-----| -> %i(...) # 9| %w(...) -#-----| -> 4 +#-----| -> self # 9| "one#{...}" #-----| -> "another" @@ -516,6 +549,9 @@ cfg.rb: # 9| "another" #-----| -> %w(...) +# 12| self +#-----| -> 4 + # 12| call to puts #-----| -> END { ... } @@ -523,6 +559,9 @@ cfg.rb: #-----| -> call to puts # 15| BEGIN { ... } +#-----| -> self + +# 16| self #-----| -> "hello" # 16| call to puts @@ -532,7 +571,7 @@ cfg.rb: #-----| -> call to puts # 19| enter END { ... } -#-----| -> "world" +#-----| -> self # 19| END { ... } #-----| -> 41 @@ -542,6 +581,9 @@ cfg.rb: # 19| exit END { ... } (normal) #-----| -> exit END { ... } +# 20| self +#-----| -> "world" + # 20| call to puts #-----| -> exit END { ... } (normal) @@ -558,7 +600,7 @@ cfg.rb: #-----| -> ... + ... # 25| call to times -#-----| -> :puts +#-----| -> self # 25| 2 #-----| -> { ... } @@ -575,6 +617,9 @@ cfg.rb: #-----| -> exit { ... } # 25| x +#-----| -> self + +# 25| self #-----| -> x # 25| call to puts @@ -583,6 +628,9 @@ cfg.rb: # 25| x #-----| -> call to puts +# 27| self +#-----| -> :puts + # 27| call to puts #-----| -> Proc @@ -639,12 +687,12 @@ cfg.rb: # 35| false #-----| false -> if ... -# 39| self -#-----| -> 42 - # 39| call to puts #-----| -> case ... +# 39| self +#-----| -> 42 + # 39| 42 #-----| -> call to puts @@ -662,6 +710,9 @@ cfg.rb: #-----| no-match -> when ... # 42| then ... +#-----| -> self + +# 42| self #-----| -> "one" # 42| call to puts @@ -686,6 +737,9 @@ cfg.rb: #-----| no-match -> else ... # 43| then ... +#-----| -> self + +# 43| self #-----| -> "some" # 43| call to puts @@ -695,6 +749,9 @@ cfg.rb: #-----| -> call to puts # 44| else ... +#-----| -> self + +# 44| self #-----| -> "many" # 44| call to puts @@ -720,6 +777,9 @@ cfg.rb: #-----| -> ... == ... # 48| then ... +#-----| -> self + +# 48| self #-----| -> "one" # 48| call to puts @@ -752,6 +812,9 @@ cfg.rb: #-----| -> ... > ... # 49| then ... +#-----| -> self + +# 49| self #-----| -> "some" # 49| call to puts @@ -809,7 +872,7 @@ cfg.rb: #-----| -> C # 60| conditional -#-----| -> call to b +#-----| -> self # 60| ... ? ... : ... #-----| -> ... = ... @@ -818,6 +881,9 @@ cfg.rb: #-----| true -> "hello" #-----| false -> "bye" +# 60| self +#-----| -> call to b + # 60| call to b #-----| -> 10 @@ -884,7 +950,7 @@ cfg.rb: #-----| -> exit pattern # 63| (..., ...) -#-----| -> a +#-----| -> self # 63| a #-----| -> b @@ -892,12 +958,18 @@ cfg.rb: # 63| b #-----| -> (..., ...) +# 64| self +#-----| -> a + # 64| call to puts -#-----| -> b +#-----| -> self # 64| a #-----| -> call to puts +# 65| self +#-----| -> b + # 65| call to puts #-----| -> exit pattern (normal) @@ -905,7 +977,7 @@ cfg.rb: #-----| -> call to puts # 67| ... = ... -#-----| -> items +#-----| -> self # 67| items #-----| -> 1 @@ -922,6 +994,9 @@ cfg.rb: # 67| 3 #-----| -> [...] +# 68| self +#-----| -> items + # 68| call to puts #-----| -> print @@ -935,7 +1010,7 @@ cfg.rb: #-----| -> ...[...] # 69| enter print -#-----| -> "silly" +#-----| -> self # 69| print #-----| -> x @@ -945,6 +1020,9 @@ cfg.rb: # 69| exit print (normal) #-----| -> exit print +# 70| self +#-----| -> "silly" + # 70| call to puts #-----| -> exit print (normal) @@ -1008,6 +1086,9 @@ cfg.rb: #-----| -> else ... # 82| else ... +#-----| -> self + +# 83| self #-----| -> "ok" # 83| call to puts @@ -1017,6 +1098,9 @@ cfg.rb: #-----| -> call to puts # 84| ensure ... +#-----| -> self + +# 85| self #-----| -> "end" # 85| call to puts @@ -1066,7 +1150,7 @@ cfg.rb: #-----| -> x # 91| if ... -#-----| -> x +#-----| -> self # 91| ... > ... #-----| true -> then ... @@ -1084,6 +1168,9 @@ cfg.rb: # 91| next #-----| next -> In +# 92| self +#-----| -> x + # 92| call to puts #-----| -> In @@ -1187,6 +1274,9 @@ cfg.rb: #-----| -> kwargs # 101| kwargs +#-----| -> self + +# 102| self #-----| -> value # 102| call to puts @@ -1217,7 +1307,7 @@ cfg.rb: #-----| -> ... = ... # 107| ... = ... -#-----| -> < self # 107| table #-----| -> "food" @@ -1225,6 +1315,9 @@ cfg.rb: # 107| "food" #-----| -> ... = ... +# 108| self +#-----| -> < b @@ -1232,10 +1325,13 @@ cfg.rb: #-----| -> call to puts # 108| < call to table +#-----| -> self # 109| #{...} -#-----| -> call to type +#-----| -> self + +# 109| self +#-----| -> call to table # 109| call to table #-----| -> #{...} @@ -1243,9 +1339,15 @@ cfg.rb: # 110| #{...} #-----| -> ( ... ) +# 110| self +#-----| -> call to type + # 110| call to type #-----| -> #{...} +# 113| self +#-----| -> "hi" + # 113| call to puts #-----| -> ... if ... @@ -1256,7 +1358,7 @@ cfg.rb: #-----| -> call to puts # 113| ... > ... -#-----| true -> "hi" +#-----| true -> self #-----| false -> ... if ... # 113| b @@ -1445,7 +1547,7 @@ cfg.rb: #-----| -> 1 # 136| ... / ... -#-----| raise -> "div by zero" +#-----| raise -> self #-----| -> init # 136| 1 @@ -1454,6 +1556,9 @@ cfg.rb: # 136| 0 #-----| -> ... / ... +# 136| self +#-----| -> "div by zero" + # 136| call to puts #-----| -> init @@ -1509,7 +1614,7 @@ cfg.rb: #-----| -> print # 145| enter print -#-----| -> "singleton" +#-----| -> self # 145| print #-----| -> silly @@ -1519,12 +1624,18 @@ cfg.rb: # 145| exit print (normal) #-----| -> exit print +# 146| self +#-----| -> "singleton" + # 146| call to puts -#-----| -> call to super +#-----| -> self # 146| "singleton" #-----| -> call to puts +# 147| self +#-----| -> call to super + # 147| call to puts #-----| -> exit print (normal) @@ -1561,6 +1672,9 @@ cfg.rb: #-----| -> method # 152| x +#-----| -> self + +# 153| self #-----| -> x # 153| call to puts @@ -1573,7 +1687,7 @@ cfg.rb: #-----| -> a # 156| two_parameters -#-----| -> 1 +#-----| -> self # 156| exit two_parameters @@ -1586,6 +1700,9 @@ cfg.rb: # 156| b #-----| -> exit two_parameters (normal) +# 158| self +#-----| -> 1 + # 158| call to two_parameters #-----| -> scriptfile @@ -1605,7 +1722,7 @@ cfg.rb: #-----| -> symbol # 160| scriptfile -#-----| -> call to __FILE__ +#-----| -> self # 160| `cat "#{...}"` #-----| -> ... = ... @@ -1613,6 +1730,9 @@ cfg.rb: # 160| #{...} #-----| -> `cat "#{...}"` +# 160| self +#-----| -> call to __FILE__ + # 160| call to __FILE__ #-----| -> #{...} @@ -1699,6 +1819,9 @@ cfg.rb: #-----| -> ... == ... # 172| then ... +#-----| -> self + +# 172| self #-----| -> "hi" # 172| call to puts @@ -1708,6 +1831,9 @@ cfg.rb: #-----| -> call to puts # 172| else ... +#-----| -> self + +# 172| self #-----| -> "bye" # 172| call to puts @@ -1716,6 +1842,9 @@ cfg.rb: # 172| "bye" #-----| -> call to puts +# 174| self +#-----| -> "hi" + # 174| call to puts #-----| -> ... unless ... @@ -1726,7 +1855,7 @@ cfg.rb: #-----| -> call to puts # 174| ... == ... -#-----| false -> "hi" +#-----| false -> self #-----| true -> ... unless ... # 174| x @@ -1752,7 +1881,7 @@ cfg.rb: #-----| -> x # 176| ... += ... -#-----| -> "hello" +#-----| -> self # 176| x #-----| -> 10 @@ -1760,6 +1889,9 @@ cfg.rb: # 176| 10 #-----| -> ... += ... +# 176| self +#-----| -> "hello" + # 176| call to puts #-----| -> x @@ -1781,6 +1913,9 @@ cfg.rb: # 179| ... until ... #-----| -> x +# 179| self +#-----| -> "hello" + # 179| call to puts #-----| -> i @@ -1797,7 +1932,7 @@ cfg.rb: #-----| -> ... += ... # 179| ... == ... -#-----| false -> "hello" +#-----| false -> self #-----| true -> ... until ... # 179| i @@ -1841,7 +1976,7 @@ cfg.rb: #-----| -> ... += ... # 184| if ... -#-----| -> x +#-----| -> self # 184| ... == ... #-----| true -> then ... @@ -1859,6 +1994,9 @@ cfg.rb: # 184| redo #-----| redo -> do ... +# 185| self +#-----| -> x + # 185| call to puts #-----| -> x @@ -1871,6 +2009,9 @@ cfg.rb: # 188| ... while ... #-----| -> run_block +# 188| self +#-----| -> "hello" + # 188| call to puts #-----| -> i @@ -1887,7 +2028,7 @@ cfg.rb: #-----| -> ... -= ... # 188| ... != ... -#-----| true -> "hello" +#-----| true -> self #-----| false -> ... while ... # 188| i @@ -1900,7 +2041,7 @@ cfg.rb: #-----| -> yield ... # 190| run_block -#-----| -> { ... } +#-----| -> self # 190| exit run_block @@ -1913,6 +2054,9 @@ cfg.rb: # 191| 42 #-----| -> exit run_block (normal) +# 194| self +#-----| -> { ... } + # 194| call to run_block #-----| -> exit cfg.rb (normal) @@ -1928,6 +2072,9 @@ cfg.rb: #-----| -> exit { ... } # 194| x +#-----| -> self + +# 194| self #-----| -> x # 194| call to puts @@ -1963,7 +2110,7 @@ exit.rb: #-----| -> x # 2| if ... -#-----| -> "x <= 2" +#-----| -> self # 2| ... > ... #-----| true -> then ... @@ -1976,6 +2123,9 @@ exit.rb: #-----| -> ... > ... # 2| then ... +#-----| -> self + +# 3| self #-----| -> 1 # 3| call to exit @@ -1984,6 +2134,9 @@ exit.rb: # 3| 1 #-----| -> call to exit +# 5| self +#-----| -> "x <= 2" + # 5| call to puts #-----| -> exit m1 (normal) @@ -2008,7 +2161,7 @@ exit.rb: #-----| -> x # 9| if ... -#-----| -> "x <= 2" +#-----| -> self # 9| ... > ... #-----| true -> then ... @@ -2021,6 +2174,9 @@ exit.rb: #-----| -> ... > ... # 9| then ... +#-----| -> self + +# 10| self #-----| -> "abort!" # 10| call to abort @@ -2029,6 +2185,9 @@ exit.rb: # 10| "abort!" #-----| -> call to abort +# 12| self +#-----| -> "x <= 2" + # 12| call to puts #-----| -> exit m2 (normal) @@ -2037,7 +2196,7 @@ exit.rb: heredoc.rb: # 1| enter double_heredoc -#-----| -> < self # 1| enter heredoc.rb #-----| -> double_heredoc @@ -2055,6 +2214,9 @@ heredoc.rb: # 1| exit heredoc.rb (normal) #-----| -> exit heredoc.rb +# 2| self +#-----| -> < exit double_heredoc (normal) @@ -2101,6 +2263,9 @@ ifs.rb: #-----| -> ... > ... # 2| then ... +#-----| -> self + +# 3| self #-----| -> "x is greater than 2" # 3| call to puts @@ -2167,6 +2332,9 @@ ifs.rb: #-----| -> ... == ... # 4| then ... +#-----| -> self + +# 5| self #-----| -> "x is 1" # 5| call to puts @@ -2176,6 +2344,9 @@ ifs.rb: #-----| -> call to puts # 6| else ... +#-----| -> self + +# 7| self #-----| -> "I can't guess the number" # 7| call to puts @@ -2235,7 +2406,7 @@ ifs.rb: #-----| -> x # 19| if ... -#-----| -> x +#-----| -> self # 19| ... < ... #-----| true -> then ... @@ -2293,6 +2464,9 @@ ifs.rb: # 22| 1 #-----| -> ... - ... +# 25| self +#-----| -> x + # 25| call to puts #-----| -> exit m3 (normal) @@ -2444,7 +2618,7 @@ ifs.rb: #-----| -> if ... # 36| enter conditional_method_def -#-----| -> "bla" +#-----| -> self # 36| conditional_method_def #-----| -> ... unless ... @@ -2457,6 +2631,9 @@ ifs.rb: # 36| exit conditional_method_def (normal) #-----| -> exit conditional_method_def +# 37| self +#-----| -> "bla" + # 37| call to puts #-----| -> exit conditional_method_def (normal) @@ -2508,13 +2685,16 @@ ifs.rb: #-----| -> b # 47| if ... -#-----| -> "done" +#-----| -> self # 47| b #-----| true -> then ... #-----| false -> else ... # 47| then ... +#-----| -> self + +# 48| self #-----| -> "true" # 48| call to puts @@ -2526,6 +2706,9 @@ ifs.rb: # 49| else ... #-----| -> if ... +# 51| self +#-----| -> "done" + # 51| call to puts #-----| -> exit empty_else (normal) @@ -2569,6 +2752,9 @@ loops.rb: #-----| -> ... >= ... # 2| do ... +#-----| -> self + +# 3| self #-----| -> x # 3| call to puts @@ -2601,7 +2787,7 @@ loops.rb: #-----| -> x # 9| while ... -#-----| -> "Done" +#-----| -> self # 9| ... >= ... #-----| true -> do ... @@ -2614,6 +2800,9 @@ loops.rb: #-----| -> ... >= ... # 9| do ... +#-----| -> self + +# 10| self #-----| -> x # 10| call to puts @@ -2632,7 +2821,7 @@ loops.rb: #-----| -> ... -= ... # 12| if ... -#-----| -> "Iter" +#-----| -> self # 12| ... > ... #-----| true -> then ... @@ -2688,12 +2877,18 @@ loops.rb: # 17| redo #-----| redo -> do ... +# 19| self +#-----| -> "Iter" + # 19| call to puts #-----| -> x # 19| "Iter" #-----| -> call to puts +# 21| self +#-----| -> "Done" + # 21| call to puts #-----| -> exit m2 (normal) @@ -2711,12 +2906,12 @@ loops.rb: # 24| exit m3 (normal) #-----| -> exit m3 -# 25| [...] -#-----| -> do ... end - # 25| call to each #-----| -> exit m3 (normal) +# 25| [...] +#-----| -> do ... end + # 25| 1 #-----| -> 2 @@ -2738,6 +2933,9 @@ loops.rb: #-----| -> exit do ... end # 25| x +#-----| -> self + +# 26| self #-----| -> x # 26| call to puts @@ -2818,7 +3016,7 @@ raise.rb: #-----| -> x # 8| if ... -#-----| -> "x <= 2" +#-----| -> self # 8| ... > ... #-----| true -> then ... @@ -2831,6 +3029,9 @@ raise.rb: #-----| -> ... > ... # 8| then ... +#-----| -> self + +# 9| self #-----| -> "x > 2" # 9| call to raise @@ -2839,6 +3040,9 @@ raise.rb: # 9| "x > 2" #-----| -> call to raise +# 11| self +#-----| -> "x <= 2" + # 11| call to puts #-----| -> exit m1 (normal) @@ -2863,13 +3067,16 @@ raise.rb: #-----| -> b # 16| if ... -#-----| -> "End m2" +#-----| -> self # 16| b #-----| true -> then ... #-----| false -> if ... # 16| then ... +#-----| -> self + +# 17| self #-----| -> ExceptionA # 17| call to raise @@ -2886,14 +3093,20 @@ raise.rb: #-----| raise -> exit m2 (abnormal) # 19| then ... +#-----| -> self + +# 20| self #-----| -> "Rescued" # 20| call to puts -#-----| -> "End m2" +#-----| -> self # 20| "Rescued" #-----| -> call to puts +# 22| self +#-----| -> "End m2" + # 22| call to puts #-----| -> exit m2 (normal) @@ -2915,13 +3128,16 @@ raise.rb: #-----| -> b # 27| if ... -#-----| -> "End m3" +#-----| -> self # 27| b #-----| true -> then ... #-----| false -> if ... # 27| then ... +#-----| -> self + +# 28| self #-----| -> ExceptionA # 28| call to raise @@ -2934,14 +3150,20 @@ raise.rb: #-----| -> then ... # 30| then ... +#-----| -> self + +# 31| self #-----| -> "Rescued" # 31| call to puts -#-----| -> "End m3" +#-----| -> self # 31| "Rescued" #-----| -> call to puts +# 33| self +#-----| -> "End m3" + # 33| call to puts #-----| -> exit m3 (normal) @@ -2963,13 +3185,16 @@ raise.rb: #-----| -> b # 38| if ... -#-----| -> "End m4" +#-----| -> self # 38| b #-----| true -> then ... #-----| false -> if ... # 38| then ... +#-----| -> self + +# 39| self #-----| -> ExceptionA # 39| call to raise @@ -2985,14 +3210,20 @@ raise.rb: #-----| -> then ... # 41| then ... +#-----| -> self + +# 42| self #-----| -> "Rescued {e}" # 42| call to puts -#-----| -> "End m4" +#-----| -> self # 42| "Rescued {e}" #-----| -> call to puts +# 44| self +#-----| -> "End m4" + # 44| call to puts #-----| -> exit m4 (normal) @@ -3014,13 +3245,16 @@ raise.rb: #-----| -> b # 49| if ... -#-----| -> "End m5" +#-----| -> self # 49| b #-----| true -> then ... #-----| false -> if ... # 49| then ... +#-----| -> self + +# 50| self #-----| -> ExceptionA # 50| call to raise @@ -3033,6 +3267,9 @@ raise.rb: #-----| -> e # 52| e +#-----| -> self + +# 54| self #-----| -> "End m5" # 54| call to puts @@ -3059,13 +3296,16 @@ raise.rb: #-----| -> b # 59| if ... -#-----| -> "End m6" +#-----| -> self # 59| b #-----| true -> then ... #-----| false -> if ... # 59| then ... +#-----| -> self + +# 60| self #-----| -> ExceptionA # 60| call to raise @@ -3089,14 +3329,20 @@ raise.rb: #-----| -> then ... # 62| then ... +#-----| -> self + +# 63| self #-----| -> "Rescued {e}" # 63| call to puts -#-----| -> "End m6" +#-----| -> self # 63| "Rescued {e}" #-----| -> call to puts +# 65| self +#-----| -> "End m6" + # 65| call to puts #-----| -> exit m6 (normal) @@ -3121,7 +3367,7 @@ raise.rb: #-----| -> x # 69| if ... -#-----| -> "0 <= x <= 2" +#-----| -> self # 69| ... > ... #-----| true -> then ... @@ -3134,6 +3380,9 @@ raise.rb: #-----| -> ... > ... # 69| then ... +#-----| -> self + +# 70| self #-----| -> "x > 2" # 70| call to raise @@ -3164,6 +3413,9 @@ raise.rb: # 72| "x < 0" #-----| -> return +# 74| self +#-----| -> "0 <= x <= 2" + # 74| call to puts #-----| -> ensure ... @@ -3171,12 +3423,21 @@ raise.rb: #-----| -> call to puts # 75| ensure ... -#-----| -> "ensure" +#-----| -> self # 75| [ensure: return] ensure ... -#-----| -> [ensure: return] "ensure" +#-----| -> [ensure: return] self # 75| [ensure: raise] ensure ... +#-----| -> [ensure: raise] self + +# 76| self +#-----| -> "ensure" + +# 76| [ensure: return] self +#-----| -> [ensure: return] "ensure" + +# 76| [ensure: raise] self #-----| -> [ensure: raise] "ensure" # 76| call to puts @@ -3212,6 +3473,9 @@ raise.rb: #-----| -> exit m8 # 79| x +#-----| -> self + +# 80| self #-----| -> "Begin m8" # 80| call to puts @@ -3221,7 +3485,7 @@ raise.rb: #-----| -> call to puts # 82| if ... -#-----| -> "0 <= x <= 2" +#-----| -> self # 82| ... > ... #-----| true -> then ... @@ -3234,6 +3498,9 @@ raise.rb: #-----| -> ... > ... # 82| then ... +#-----| -> self + +# 83| self #-----| -> "x > 2" # 83| call to raise @@ -3264,6 +3531,9 @@ raise.rb: # 85| "x < 0" #-----| -> return +# 87| self +#-----| -> "0 <= x <= 2" + # 87| call to puts #-----| -> ensure ... @@ -3271,16 +3541,25 @@ raise.rb: #-----| -> call to puts # 88| ensure ... -#-----| -> "ensure" +#-----| -> self # 88| [ensure: return] ensure ... -#-----| -> [ensure: return] "ensure" +#-----| -> [ensure: return] self # 88| [ensure: raise] ensure ... +#-----| -> [ensure: raise] self + +# 89| self +#-----| -> "ensure" + +# 89| [ensure: return] self +#-----| -> [ensure: return] "ensure" + +# 89| [ensure: raise] self #-----| -> [ensure: raise] "ensure" # 89| call to puts -#-----| -> "End m8" +#-----| -> self # 89| [ensure: return] call to puts #-----| return -> exit m8 (normal) @@ -3297,6 +3576,9 @@ raise.rb: # 89| [ensure: raise] "ensure" #-----| -> [ensure: raise] call to puts +# 91| self +#-----| -> "End m8" + # 91| call to puts #-----| -> exit m8 (normal) @@ -3324,6 +3606,9 @@ raise.rb: #-----| -> b2 # 94| b2 +#-----| -> self + +# 95| self #-----| -> "Begin m9" # 95| call to puts @@ -3333,7 +3618,7 @@ raise.rb: #-----| -> call to puts # 97| if ... -#-----| -> "0 <= x <= 2" +#-----| -> self # 97| ... > ... #-----| true -> then ... @@ -3346,6 +3631,9 @@ raise.rb: #-----| -> ... > ... # 97| then ... +#-----| -> self + +# 98| self #-----| -> "x > 2" # 98| call to raise @@ -3376,6 +3664,9 @@ raise.rb: # 100| "x < 0" #-----| -> return +# 102| self +#-----| -> "0 <= x <= 2" + # 102| call to puts #-----| -> ensure ... @@ -3383,12 +3674,21 @@ raise.rb: #-----| -> call to puts # 103| ensure ... -#-----| -> "outer ensure" +#-----| -> self # 103| [ensure: return] ensure ... -#-----| -> [ensure: return] "outer ensure" +#-----| -> [ensure: return] self # 103| [ensure: raise] ensure ... +#-----| -> [ensure: raise] self + +# 104| self +#-----| -> "outer ensure" + +# 104| [ensure: return] self +#-----| -> [ensure: return] "outer ensure" + +# 104| [ensure: raise] self #-----| -> [ensure: raise] "outer ensure" # 104| call to puts @@ -3431,12 +3731,21 @@ raise.rb: #-----| false -> [ensure: raise] if ... # 106| then ... -#-----| -> "b1 is true" +#-----| -> self # 106| [ensure: return] then ... -#-----| -> [ensure: return] "b1 is true" +#-----| -> [ensure: return] self # 106| [ensure: raise] then ... +#-----| -> [ensure: raise] self + +# 107| self +#-----| -> "b1 is true" + +# 107| [ensure: return] self +#-----| -> [ensure: return] "b1 is true" + +# 107| [ensure: raise] self #-----| -> [ensure: raise] "b1 is true" # 107| call to raise @@ -3458,25 +3767,43 @@ raise.rb: #-----| -> [ensure: raise] call to raise # 109| ensure ... -#-----| -> "inner ensure" +#-----| -> self # 109| [ensure(1): raise] ensure ... -#-----| -> [ensure(1): raise] "inner ensure" +#-----| -> [ensure(1): raise] self # 109| [ensure: return] ensure ... -#-----| -> [ensure: return] "inner ensure" +#-----| -> [ensure: return] self # 109| [ensure: return, ensure(1): raise] ensure ... -#-----| -> [ensure: return, ensure(1): raise] "inner ensure" +#-----| -> [ensure: return, ensure(1): raise] self # 109| [ensure: raise] ensure ... -#-----| -> [ensure: raise] "inner ensure" +#-----| -> [ensure: raise] self # 109| [ensure: raise, ensure(1): raise] ensure ... +#-----| -> [ensure: raise, ensure(1): raise] self + +# 110| self +#-----| -> "inner ensure" + +# 110| [ensure(1): raise] self +#-----| -> [ensure(1): raise] "inner ensure" + +# 110| [ensure: return] self +#-----| -> [ensure: return] "inner ensure" + +# 110| [ensure: return, ensure(1): raise] self +#-----| -> [ensure: return, ensure(1): raise] "inner ensure" + +# 110| [ensure: raise] self +#-----| -> [ensure: raise] "inner ensure" + +# 110| [ensure: raise, ensure(1): raise] self #-----| -> [ensure: raise, ensure(1): raise] "inner ensure" # 110| call to puts -#-----| -> "End m9" +#-----| -> self # 110| [ensure(1): raise] call to puts #-----| raise -> [ensure: raise] ensure ... @@ -3511,6 +3838,9 @@ raise.rb: # 110| [ensure: raise, ensure(1): raise] "inner ensure" #-----| -> [ensure: raise, ensure(1): raise] call to puts +# 113| self +#-----| -> "End m9" + # 113| call to puts #-----| -> ensure ... @@ -3518,12 +3848,21 @@ raise.rb: #-----| -> call to puts # 114| ensure ... -#-----| -> "method ensure" +#-----| -> self # 114| [ensure: return] ensure ... -#-----| -> [ensure: return] "method ensure" +#-----| -> [ensure: return] self # 114| [ensure: raise] ensure ... +#-----| -> [ensure: raise] self + +# 115| self +#-----| -> "method ensure" + +# 115| [ensure: return] self +#-----| -> [ensure: return] "method ensure" + +# 115| [ensure: raise] self #-----| -> [ensure: raise] "method ensure" # 115| call to puts @@ -3566,12 +3905,21 @@ raise.rb: #-----| false -> [ensure: raise] if ... # 116| then ... -#-----| -> "b2 is true" +#-----| -> self # 116| [ensure: return] then ... -#-----| -> [ensure: return] "b2 is true" +#-----| -> [ensure: return] self # 116| [ensure: raise] then ... +#-----| -> [ensure: raise] self + +# 117| self +#-----| -> "b2 is true" + +# 117| [ensure: return] self +#-----| -> [ensure: return] "b2 is true" + +# 117| [ensure: raise] self #-----| -> [ensure: raise] "b2 is true" # 117| call to raise @@ -3607,9 +3955,12 @@ raise.rb: #-----| -> exit m10 # 121| p -#-----| no-match -> "Exception" +#-----| no-match -> self #-----| match -> ensure ... +# 121| self +#-----| -> "Exception" + # 121| call to raise #-----| raise -> exit m10 (abnormal) @@ -3617,6 +3968,9 @@ raise.rb: #-----| -> call to raise # 124| ensure ... +#-----| -> self + +# 125| self #-----| -> "Will not get executed if p is..." # 125| call to puts @@ -3650,6 +4004,9 @@ raise.rb: #-----| false -> if ... # 130| then ... +#-----| -> self + +# 131| self #-----| -> ExceptionA # 131| call to raise @@ -3673,6 +4030,9 @@ raise.rb: #-----| raise -> [ensure: raise] ensure ... # 134| then ... +#-----| -> self + +# 135| self #-----| -> "ExceptionB" # 135| call to puts @@ -3682,13 +4042,19 @@ raise.rb: #-----| -> call to puts # 136| ensure ... -#-----| -> "Ensure" +#-----| -> self # 136| [ensure: raise] ensure ... +#-----| -> [ensure: raise] self + +# 137| self +#-----| -> "Ensure" + +# 137| [ensure: raise] self #-----| -> [ensure: raise] "Ensure" # 137| call to puts -#-----| -> "End m11" +#-----| -> self # 137| [ensure: raise] call to puts #-----| raise -> exit m11 (abnormal) @@ -3699,6 +4065,9 @@ raise.rb: # 137| [ensure: raise] "Ensure" #-----| -> [ensure: raise] call to puts +# 139| self +#-----| -> "End m11" + # 139| call to puts #-----| -> exit m11 (normal) @@ -3727,6 +4096,9 @@ raise.rb: #-----| false -> if ... # 143| then ... +#-----| -> self + +# 144| self #-----| -> "" # 144| call to raise @@ -3804,6 +4176,9 @@ raise.rb: # 155| elem #-----| -> element +# 155| self +#-----| -> "" + # 155| call to raise #-----| raise -> exit { ... } (abnormal) @@ -3814,7 +4189,7 @@ raise.rb: #-----| -> call to raise # 155| call to nil? -#-----| true -> "" +#-----| true -> self #-----| false -> ... if ... # 155| element diff --git a/ql/test/library-tests/variables/ssa.expected b/ql/test/library-tests/variables/ssa.expected index 513d0029e8c..f6aad2b343d 100644 --- a/ql/test/library-tests/variables/ssa.expected +++ b/ql/test/library-tests/variables/ssa.expected @@ -26,11 +26,11 @@ definition | parameters.rb:35:1:38:3 | | parameters.rb:35:16:35:16 | b | | parameters.rb:35:11:35:11 | a | parameters.rb:35:11:35:11 | a | | parameters.rb:35:16:35:20 | ... = ... | parameters.rb:35:16:35:16 | b | -| parameters.rb:37:11:37:11 | phi | parameters.rb:35:16:35:16 | b | +| parameters.rb:37:3:37:18 | phi | parameters.rb:35:16:35:16 | b | | parameters.rb:40:1:43:3 | | parameters.rb:40:15:40:15 | e | | parameters.rb:40:12:40:12 | d | parameters.rb:40:12:40:12 | d | | parameters.rb:40:15:40:19 | ... = ... | parameters.rb:40:15:40:15 | e | -| parameters.rb:42:11:42:11 | phi | parameters.rb:40:15:40:15 | e | +| parameters.rb:42:3:42:18 | phi | parameters.rb:40:15:40:15 | e | | parameters.rb:45:20:45:20 | _ | parameters.rb:45:20:45:20 | _ | | parameters.rb:49:13:49:13 | a | parameters.rb:49:13:49:13 | a | | parameters.rb:49:15:49:15 | b | parameters.rb:49:15:49:15 | b | @@ -38,7 +38,7 @@ definition | parameters.rb:54:9:57:3 | | parameters.rb:53:1:53:1 | x | | parameters.rb:54:14:54:14 | y | parameters.rb:54:14:54:14 | y | | parameters.rb:54:19:54:23 | ... = ... | parameters.rb:53:1:53:1 | x | -| parameters.rb:55:9:55:9 | phi | parameters.rb:53:1:53:1 | x | +| parameters.rb:55:4:55:9 | phi | parameters.rb:53:1:53:1 | x | | scopes.rb:4:4:4:8 | ... = ... | scopes.rb:4:4:4:4 | a | | scopes.rb:7:1:7:5 | ... = ... | scopes.rb:7:1:7:1 | a | | scopes.rb:9:9:18:3 | | scopes.rb:7:1:7:1 | a | @@ -68,7 +68,7 @@ definition | ssa.rb:45:3:45:12 | phi | ssa.rb:45:3:45:3 | x | | ssa.rb:49:1:51:3 | | ssa.rb:49:14:49:14 | y | | ssa.rb:49:14:49:19 | ... = ... | ssa.rb:49:14:49:14 | y | -| ssa.rb:50:8:50:8 | phi | ssa.rb:49:14:49:14 | y | +| ssa.rb:50:3:50:8 | phi | ssa.rb:49:14:49:14 | y | | ssa.rb:53:8:53:10 | foo | ssa.rb:53:8:53:10 | foo | | ssa.rb:54:3:54:11 | ... = ... | ssa.rb:54:3:54:3 | x | | ssa.rb:59:3:59:8 | ... = ... | ssa.rb:59:3:59:3 | x | @@ -113,14 +113,14 @@ read | parameters.rb:30:24:30:29 | middle | parameters.rb:30:24:30:29 | middle | parameters.rb:31:20:31:25 | middle | | parameters.rb:30:36:30:39 | last | parameters.rb:30:36:30:39 | last | parameters.rb:31:30:31:33 | last | | parameters.rb:35:11:35:11 | a | parameters.rb:35:11:35:11 | a | parameters.rb:37:11:37:11 | a | -| parameters.rb:37:11:37:11 | phi | parameters.rb:35:16:35:16 | b | parameters.rb:37:16:37:16 | b | +| parameters.rb:37:3:37:18 | phi | parameters.rb:35:16:35:16 | b | parameters.rb:37:16:37:16 | b | | parameters.rb:40:12:40:12 | d | parameters.rb:40:12:40:12 | d | parameters.rb:42:11:42:11 | d | -| parameters.rb:42:11:42:11 | phi | parameters.rb:40:15:40:15 | e | parameters.rb:42:16:42:16 | e | +| parameters.rb:42:3:42:18 | phi | parameters.rb:40:15:40:15 | e | parameters.rb:42:16:42:16 | e | | parameters.rb:45:20:45:20 | _ | parameters.rb:45:20:45:20 | _ | parameters.rb:46:8:46:8 | _ | | parameters.rb:49:13:49:13 | a | parameters.rb:49:13:49:13 | a | parameters.rb:50:11:50:11 | a | | parameters.rb:49:15:49:15 | b | parameters.rb:49:15:49:15 | b | parameters.rb:50:16:50:16 | b | | parameters.rb:54:14:54:14 | y | parameters.rb:54:14:54:14 | y | parameters.rb:56:9:56:9 | y | -| parameters.rb:55:9:55:9 | phi | parameters.rb:53:1:53:1 | x | parameters.rb:55:9:55:9 | x | +| parameters.rb:55:4:55:9 | phi | parameters.rb:53:1:53:1 | x | parameters.rb:55:9:55:9 | x | | scopes.rb:4:4:4:8 | ... = ... | scopes.rb:4:4:4:4 | a | scopes.rb:5:9:5:9 | a | | scopes.rb:7:1:7:5 | ... = ... | scopes.rb:7:1:7:1 | a | scopes.rb:8:6:8:6 | a | | scopes.rb:9:9:18:3 | | scopes.rb:7:1:7:1 | a | scopes.rb:10:9:10:9 | a | @@ -153,7 +153,7 @@ read | ssa.rb:40:3:40:9 | ... = ... | ssa.rb:40:3:40:4 | m3 | ssa.rb:41:8:41:9 | m3 | | ssa.rb:44:8:44:8 | b | ssa.rb:44:8:44:8 | b | ssa.rb:45:12:45:12 | b | | ssa.rb:45:3:45:12 | phi | ssa.rb:45:3:45:3 | x | ssa.rb:46:8:46:8 | x | -| ssa.rb:50:8:50:8 | phi | ssa.rb:49:14:49:14 | y | ssa.rb:50:8:50:8 | y | +| ssa.rb:50:3:50:8 | phi | ssa.rb:49:14:49:14 | y | ssa.rb:50:8:50:8 | y | | ssa.rb:53:8:53:10 | foo | ssa.rb:53:8:53:10 | foo | ssa.rb:54:7:54:9 | foo | | ssa.rb:54:3:54:11 | ... = ... | ssa.rb:54:3:54:3 | x | ssa.rb:55:8:55:8 | x | | ssa.rb:59:3:59:8 | ... = ... | ssa.rb:59:3:59:3 | x | ssa.rb:60:3:60:3 | x | @@ -193,14 +193,14 @@ firstRead | parameters.rb:30:24:30:29 | middle | parameters.rb:30:24:30:29 | middle | parameters.rb:31:20:31:25 | middle | | parameters.rb:30:36:30:39 | last | parameters.rb:30:36:30:39 | last | parameters.rb:31:30:31:33 | last | | parameters.rb:35:11:35:11 | a | parameters.rb:35:11:35:11 | a | parameters.rb:37:11:37:11 | a | -| parameters.rb:37:11:37:11 | phi | parameters.rb:35:16:35:16 | b | parameters.rb:37:16:37:16 | b | +| parameters.rb:37:3:37:18 | phi | parameters.rb:35:16:35:16 | b | parameters.rb:37:16:37:16 | b | | parameters.rb:40:12:40:12 | d | parameters.rb:40:12:40:12 | d | parameters.rb:42:11:42:11 | d | -| parameters.rb:42:11:42:11 | phi | parameters.rb:40:15:40:15 | e | parameters.rb:42:16:42:16 | e | +| parameters.rb:42:3:42:18 | phi | parameters.rb:40:15:40:15 | e | parameters.rb:42:16:42:16 | e | | parameters.rb:45:20:45:20 | _ | parameters.rb:45:20:45:20 | _ | parameters.rb:46:8:46:8 | _ | | parameters.rb:49:13:49:13 | a | parameters.rb:49:13:49:13 | a | parameters.rb:50:11:50:11 | a | | parameters.rb:49:15:49:15 | b | parameters.rb:49:15:49:15 | b | parameters.rb:50:16:50:16 | b | | parameters.rb:54:14:54:14 | y | parameters.rb:54:14:54:14 | y | parameters.rb:56:9:56:9 | y | -| parameters.rb:55:9:55:9 | phi | parameters.rb:53:1:53:1 | x | parameters.rb:55:9:55:9 | x | +| parameters.rb:55:4:55:9 | phi | parameters.rb:53:1:53:1 | x | parameters.rb:55:9:55:9 | x | | scopes.rb:4:4:4:8 | ... = ... | scopes.rb:4:4:4:4 | a | scopes.rb:5:9:5:9 | a | | scopes.rb:7:1:7:5 | ... = ... | scopes.rb:7:1:7:1 | a | scopes.rb:8:6:8:6 | a | | scopes.rb:9:9:18:3 | | scopes.rb:7:1:7:1 | a | scopes.rb:10:9:10:9 | a | @@ -223,7 +223,7 @@ firstRead | ssa.rb:40:3:40:9 | ... = ... | ssa.rb:40:3:40:4 | m3 | ssa.rb:41:8:41:9 | m3 | | ssa.rb:44:8:44:8 | b | ssa.rb:44:8:44:8 | b | ssa.rb:45:12:45:12 | b | | ssa.rb:45:3:45:12 | phi | ssa.rb:45:3:45:3 | x | ssa.rb:46:8:46:8 | x | -| ssa.rb:50:8:50:8 | phi | ssa.rb:49:14:49:14 | y | ssa.rb:50:8:50:8 | y | +| ssa.rb:50:3:50:8 | phi | ssa.rb:49:14:49:14 | y | ssa.rb:50:8:50:8 | y | | ssa.rb:53:8:53:10 | foo | ssa.rb:53:8:53:10 | foo | ssa.rb:54:7:54:9 | foo | | ssa.rb:54:3:54:11 | ... = ... | ssa.rb:54:3:54:3 | x | ssa.rb:55:8:55:8 | x | | ssa.rb:59:3:59:8 | ... = ... | ssa.rb:59:3:59:3 | x | ssa.rb:60:3:60:3 | x | @@ -262,14 +262,14 @@ lastRead | parameters.rb:30:24:30:29 | middle | parameters.rb:30:24:30:29 | middle | parameters.rb:31:20:31:25 | middle | | parameters.rb:30:36:30:39 | last | parameters.rb:30:36:30:39 | last | parameters.rb:31:30:31:33 | last | | parameters.rb:35:11:35:11 | a | parameters.rb:35:11:35:11 | a | parameters.rb:37:11:37:11 | a | -| parameters.rb:37:11:37:11 | phi | parameters.rb:35:16:35:16 | b | parameters.rb:37:16:37:16 | b | +| parameters.rb:37:3:37:18 | phi | parameters.rb:35:16:35:16 | b | parameters.rb:37:16:37:16 | b | | parameters.rb:40:12:40:12 | d | parameters.rb:40:12:40:12 | d | parameters.rb:42:11:42:11 | d | -| parameters.rb:42:11:42:11 | phi | parameters.rb:40:15:40:15 | e | parameters.rb:42:16:42:16 | e | +| parameters.rb:42:3:42:18 | phi | parameters.rb:40:15:40:15 | e | parameters.rb:42:16:42:16 | e | | parameters.rb:45:20:45:20 | _ | parameters.rb:45:20:45:20 | _ | parameters.rb:46:8:46:8 | _ | | parameters.rb:49:13:49:13 | a | parameters.rb:49:13:49:13 | a | parameters.rb:50:11:50:11 | a | | parameters.rb:49:15:49:15 | b | parameters.rb:49:15:49:15 | b | parameters.rb:50:16:50:16 | b | | parameters.rb:54:14:54:14 | y | parameters.rb:54:14:54:14 | y | parameters.rb:56:9:56:9 | y | -| parameters.rb:55:9:55:9 | phi | parameters.rb:53:1:53:1 | x | parameters.rb:55:9:55:9 | x | +| parameters.rb:55:4:55:9 | phi | parameters.rb:53:1:53:1 | x | parameters.rb:55:9:55:9 | x | | scopes.rb:4:4:4:8 | ... = ... | scopes.rb:4:4:4:4 | a | scopes.rb:5:9:5:9 | a | | scopes.rb:7:1:7:5 | ... = ... | scopes.rb:7:1:7:1 | a | scopes.rb:8:6:8:6 | a | | scopes.rb:9:9:18:3 | | scopes.rb:7:1:7:1 | a | scopes.rb:11:4:11:4 | a | @@ -293,7 +293,7 @@ lastRead | ssa.rb:40:3:40:9 | ... = ... | ssa.rb:40:3:40:4 | m3 | ssa.rb:41:8:41:9 | m3 | | ssa.rb:44:8:44:8 | b | ssa.rb:44:8:44:8 | b | ssa.rb:45:12:45:12 | b | | ssa.rb:45:3:45:12 | phi | ssa.rb:45:3:45:3 | x | ssa.rb:46:8:46:8 | x | -| ssa.rb:50:8:50:8 | phi | ssa.rb:49:14:49:14 | y | ssa.rb:50:8:50:8 | y | +| ssa.rb:50:3:50:8 | phi | ssa.rb:49:14:49:14 | y | ssa.rb:50:8:50:8 | y | | ssa.rb:53:8:53:10 | foo | ssa.rb:53:8:53:10 | foo | ssa.rb:54:7:54:9 | foo | | ssa.rb:54:3:54:11 | ... = ... | ssa.rb:54:3:54:3 | x | ssa.rb:55:8:55:8 | x | | ssa.rb:59:3:59:8 | ... = ... | ssa.rb:59:3:59:3 | x | ssa.rb:60:3:60:3 | x | @@ -320,12 +320,12 @@ adjacentReads | ssa.rb:19:9:19:9 | phi | ssa.rb:18:8:18:8 | x | ssa.rb:20:10:20:10 | x | ssa.rb:21:5:21:5 | x | | ssa.rb:66:11:70:5 | | ssa.rb:65:3:65:10 | captured | ssa.rb:68:10:68:17 | captured | ssa.rb:69:5:69:12 | captured | phi -| parameters.rb:37:11:37:11 | phi | parameters.rb:35:16:35:16 | b | parameters.rb:35:1:38:3 | | -| parameters.rb:37:11:37:11 | phi | parameters.rb:35:16:35:16 | b | parameters.rb:35:16:35:20 | ... = ... | -| parameters.rb:42:11:42:11 | phi | parameters.rb:40:15:40:15 | e | parameters.rb:40:1:43:3 | | -| parameters.rb:42:11:42:11 | phi | parameters.rb:40:15:40:15 | e | parameters.rb:40:15:40:19 | ... = ... | -| parameters.rb:55:9:55:9 | phi | parameters.rb:53:1:53:1 | x | parameters.rb:54:9:57:3 | | -| parameters.rb:55:9:55:9 | phi | parameters.rb:53:1:53:1 | x | parameters.rb:54:19:54:23 | ... = ... | +| parameters.rb:37:3:37:18 | phi | parameters.rb:35:16:35:16 | b | parameters.rb:35:1:38:3 | | +| parameters.rb:37:3:37:18 | phi | parameters.rb:35:16:35:16 | b | parameters.rb:35:16:35:20 | ... = ... | +| parameters.rb:42:3:42:18 | phi | parameters.rb:40:15:40:15 | e | parameters.rb:40:1:43:3 | | +| parameters.rb:42:3:42:18 | phi | parameters.rb:40:15:40:15 | e | parameters.rb:40:15:40:19 | ... = ... | +| parameters.rb:55:4:55:9 | phi | parameters.rb:53:1:53:1 | x | parameters.rb:54:9:57:3 | | +| parameters.rb:55:4:55:9 | phi | parameters.rb:53:1:53:1 | x | parameters.rb:54:19:54:23 | ... = ... | | ssa.rb:5:3:13:5 | phi | ssa.rb:2:3:2:3 | i | ssa.rb:6:5:6:9 | ... = ... | | ssa.rb:5:3:13:5 | phi | ssa.rb:2:3:2:3 | i | ssa.rb:10:5:10:9 | ... = ... | | ssa.rb:19:9:19:9 | phi | ssa.rb:18:8:18:8 | x | ssa.rb:18:8:18:8 | x | @@ -334,5 +334,5 @@ phi | ssa.rb:26:12:26:22 | phi | ssa.rb:26:7:26:10 | elem | ssa.rb:26:7:26:10 | elem | | ssa.rb:45:3:45:12 | phi | ssa.rb:45:3:45:3 | x | ssa.rb:44:1:47:3 | | | ssa.rb:45:3:45:12 | phi | ssa.rb:45:3:45:3 | x | ssa.rb:45:3:45:7 | ... = ... | -| ssa.rb:50:8:50:8 | phi | ssa.rb:49:14:49:14 | y | ssa.rb:49:1:51:3 | | -| ssa.rb:50:8:50:8 | phi | ssa.rb:49:14:49:14 | y | ssa.rb:49:14:49:19 | ... = ... | +| ssa.rb:50:3:50:8 | phi | ssa.rb:49:14:49:14 | y | ssa.rb:49:1:51:3 | | +| ssa.rb:50:3:50:8 | phi | ssa.rb:49:14:49:14 | y | ssa.rb:49:14:49:19 | ... = ... |