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
912912 }
913913
914914 private LValueReferenceType getLValueReferenceType ( ) {
915+ // The extractor ensures `result` exists when `isNonReferenceStructuredBinding(expr.getTarget())` holds.
915916 result .getBaseType ( ) = expr .getUnspecifiedType ( )
916917 }
917918
Original file line number Diff line number Diff line change @@ -41,7 +41,9 @@ Type getVariableType(Variable v) {
4141 not exists ( v .getInitializer ( ) ) and result = v .getType ( )
4242 else
4343 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 )
4547 else result = v .getType ( )
4648 )
4749}
You can’t perform that action at this time.
0 commit comments