File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
cpp/ql/lib/semmle/code/cpp/ir
implementation/raw/internal Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -912,6 +912,7 @@ class TranslatedStructuredBindingVariableAccess extends TranslatedNonConstantExp
912
912
}
913
913
914
914
private LValueReferenceType getLValueReferenceType ( ) {
915
+ // The extractor ensures `result` exists when `isNonReferenceStructuredBinding(expr.getTarget())` holds.
915
916
result .getBaseType ( ) = expr .getUnspecifiedType ( )
916
917
}
917
918
Original file line number Diff line number Diff line change @@ -41,7 +41,9 @@ Type getVariableType(Variable v) {
41
41
not exists ( v .getInitializer ( ) ) and result = v .getType ( )
42
42
else
43
43
if isNonReferenceStructuredBinding ( v )
44
- then exists ( LValueReferenceType r | r .getBaseType ( ) = v .getUnspecifiedType ( ) | result = r )
44
+ then
45
+ // The extractor ensures `r` exists when `isNonReferenceStructuredBinding(v)` holds.
46
+ exists ( LValueReferenceType r | r .getBaseType ( ) = v .getUnspecifiedType ( ) | result = r )
45
47
else result = v .getType ( )
46
48
)
47
49
}
You can’t perform that action at this time.
0 commit comments