@@ -405,7 +405,11 @@ class InstructionNode extends Node0 {
405405 /** Gets the instruction corresponding to this node. */
406406 Instruction getInstruction ( ) { result = instr }
407407
408- override Location getLocationImpl ( ) { result = instr .getAst ( ) .getLocation ( ) }
408+ override Location getLocationImpl ( ) {
409+ if exists ( instr .getAst ( ) .getLocation ( ) )
410+ then result = instr .getAst ( ) .getLocation ( )
411+ else result instanceof UnknownDefaultLocation
412+ }
409413
410414 override string toStringImpl ( ) {
411415 if instr .( InitializeParameterInstruction ) .getIRVariable ( ) instanceof IRThisVariable
@@ -426,7 +430,11 @@ class OperandNode extends Node, Node0 {
426430 /** Gets the operand corresponding to this node. */
427431 Operand getOperand ( ) { result = op }
428432
429- override Location getLocationImpl ( ) { result = op .getDef ( ) .getAst ( ) .getLocation ( ) }
433+ override Location getLocationImpl ( ) {
434+ if exists ( op .getDef ( ) .getAst ( ) .getLocation ( ) )
435+ then result = op .getDef ( ) .getAst ( ) .getLocation ( )
436+ else result instanceof UnknownDefaultLocation
437+ }
430438
431439 override string toStringImpl ( ) {
432440 if op .getDef ( ) .( InitializeParameterInstruction ) .getIRVariable ( ) instanceof IRThisVariable
@@ -641,6 +649,8 @@ class IndirectParameterNode extends Node, IndirectInstruction {
641649
642650 override Declaration getFunction ( ) { result = this .getInstruction ( ) .getEnclosingFunction ( ) }
643651
652+ override Location getLocationImpl ( ) { result = this .getParameter ( ) .getLocation ( ) }
653+
644654 override string toStringImpl ( ) {
645655 result = this .getParameter ( ) .toString ( ) + " indirection"
646656 or
@@ -888,7 +898,11 @@ class RawIndirectOperand extends Node, TRawIndirectOperand {
888898 )
889899 }
890900
891- final override Location getLocationImpl ( ) { result = this .getOperand ( ) .getLocation ( ) }
901+ final override Location getLocationImpl ( ) {
902+ if exists ( this .getOperand ( ) .getLocation ( ) )
903+ then result = this .getOperand ( ) .getLocation ( )
904+ else result instanceof UnknownDefaultLocation
905+ }
892906
893907 override string toStringImpl ( ) {
894908 result = instructionNode ( this .getOperand ( ) .getDef ( ) ) .toStringImpl ( ) + " indirection"
@@ -987,7 +1001,11 @@ class RawIndirectInstruction extends Node, TRawIndirectInstruction {
9871001 )
9881002 }
9891003
990- final override Location getLocationImpl ( ) { result = this .getInstruction ( ) .getLocation ( ) }
1004+ final override Location getLocationImpl ( ) {
1005+ if exists ( this .getInstruction ( ) .getLocation ( ) )
1006+ then result = this .getInstruction ( ) .getLocation ( )
1007+ else result instanceof UnknownDefaultLocation
1008+ }
9911009
9921010 override string toStringImpl ( ) {
9931011 result = instructionNode ( this .getInstruction ( ) ) .toStringImpl ( ) + " indirection"
0 commit comments