Skip to content

Commit b4a947d

Browse files
committed
C++: add getIRVariable for this temp variables
1 parent 8a53dc8 commit b4a947d

File tree

3 files changed

+35
-33
lines changed

3 files changed

+35
-33
lines changed

cpp/ql/src/semmle/code/cpp/ir/implementation/raw/internal/TranslatedExpr.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,11 @@ class TranslatedThisExpr extends TranslatedNonConstantExpr {
694694
operandTag instanceof AddressOperandTag and
695695
result = getInstruction(ThisAddressTag())
696696
}
697+
698+
override IRVariable getInstructionVariable(InstructionTag tag) {
699+
tag = ThisAddressTag() and
700+
result = this.getEnclosingFunction().getThisVariable()
701+
}
697702
}
698703

699704
abstract class TranslatedVariableAccess extends TranslatedNonConstantExpr {
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
| escape.cpp:211:7:211:7 | c |
2-
| escape.cpp:219:7:219:8 | c3 |
3-
| escape.cpp:223:7:223:8 | c4 |

0 commit comments

Comments
 (0)