File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
cpp/ql/lib/semmle/code/cpp/ir
implementation/raw/internal Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -895,15 +895,15 @@ class TranslatedStructuredBindingVariableAccess extends TranslatedNonConstantExp
895
895
override predicate hasInstruction ( Opcode opcode , InstructionTag tag , CppType resultType ) {
896
896
tag = StructuredBindingAccessTag ( ) and
897
897
opcode instanceof Opcode:: VariableAddress and
898
- resultType = getTypeForGLValue ( this .getReferenceType ( ) )
898
+ resultType = getTypeForGLValue ( this .getLValueReferenceType ( ) )
899
899
or
900
900
tag = LoadTag ( ) and
901
901
opcode instanceof Opcode:: Load and
902
- resultType = getTypeForPRValue ( this .getReferenceType ( ) )
902
+ resultType = getTypeForPRValue ( this .getLValueReferenceType ( ) )
903
903
}
904
904
905
- private Type getReferenceType ( ) {
906
- result .( LValueReferenceType ) . getBaseType ( ) = expr .getUnderlyingType ( )
905
+ private LValueReferenceType getLValueReferenceType ( ) {
906
+ result .getBaseType ( ) = expr .getUnspecifiedType ( )
907
907
}
908
908
909
909
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) {
17
17
*/
18
18
predicate isNonReferenceStructuredBinding ( Variable v ) {
19
19
v .isStructuredBinding ( ) and
20
- not v .getUnderlyingType ( ) instanceof ReferenceType
20
+ not v .getUnspecifiedType ( ) instanceof ReferenceType
21
21
}
22
22
23
23
/**
@@ -41,7 +41,7 @@ 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 .getUnderlyingType ( ) | result = r )
44
+ then exists ( LValueReferenceType r | r .getBaseType ( ) = v .getUnspecifiedType ( ) | result = r )
45
45
else result = v .getType ( )
46
46
)
47
47
}
You can’t perform that action at this time.
0 commit comments