File tree Expand file tree Collapse file tree
cpp/ql/lib/semmle/code/cpp/ir
implementation/raw/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -895,15 +895,15 @@ class TranslatedStructuredBindingVariableAccess extends TranslatedNonConstantExp
895895 override predicate hasInstruction ( Opcode opcode , InstructionTag tag , CppType resultType ) {
896896 tag = StructuredBindingAccessTag ( ) and
897897 opcode instanceof Opcode:: VariableAddress and
898- resultType = getTypeForGLValue ( this .getReferenceType ( ) )
898+ resultType = getTypeForGLValue ( this .getLValueReferenceType ( ) )
899899 or
900900 tag = LoadTag ( ) and
901901 opcode instanceof Opcode:: Load and
902- resultType = getTypeForPRValue ( this .getReferenceType ( ) )
902+ resultType = getTypeForPRValue ( this .getLValueReferenceType ( ) )
903903 }
904904
905- private Type getReferenceType ( ) {
906- result .( LValueReferenceType ) . getBaseType ( ) = expr .getUnderlyingType ( )
905+ private LValueReferenceType getLValueReferenceType ( ) {
906+ result .getBaseType ( ) = expr .getUnspecifiedType ( )
907907 }
908908
909909 override Instruction getInstructionRegisterOperand ( InstructionTag tag , OperandTag operandTag ) {
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ private Type getDecayedType(Type type) {
1717 */
1818predicate isNonReferenceStructuredBinding ( Variable v ) {
1919 v .isStructuredBinding ( ) and
20- not v .getUnderlyingType ( ) instanceof ReferenceType
20+ not v .getUnspecifiedType ( ) instanceof ReferenceType
2121}
2222
2323/**
@@ -41,7 +41,7 @@ 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 .getUnderlyingType ( ) | result = r )
44+ then exists ( LValueReferenceType r | r .getBaseType ( ) = v .getUnspecifiedType ( ) | result = r )
4545 else result = v .getType ( )
4646 )
4747}
You can’t perform that action at this time.
0 commit comments