File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -888,10 +888,21 @@ class TranslatedNonFieldVariableAccess extends TranslatedVariableAccess {
888
888
889
889
override IRVariable getInstructionVariable ( InstructionTag tag ) {
890
890
tag = OnlyInstructionTag ( ) and
891
- result = getIRUserVariable ( getEnclosingDeclaration ( expr ) , expr .getTarget ( ) )
891
+ exists ( Declaration d , Variable v |
892
+ accessHasEnclosingDeclarationAndVariable ( d , v , expr ) and
893
+ result = getIRUserVariable ( d , v )
894
+ )
892
895
}
893
896
}
894
897
898
+ pragma [ nomagic]
899
+ private predicate accessHasEnclosingDeclarationAndVariable (
900
+ Declaration d , Variable v , VariableAccess va
901
+ ) {
902
+ d = getEnclosingDeclaration ( va ) and
903
+ v = va .getTarget ( )
904
+ }
905
+
895
906
class TranslatedFieldAccess extends TranslatedVariableAccess {
896
907
override FieldAccess expr ;
897
908
You can’t perform that action at this time.
0 commit comments