mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
C++: Fix duplicate result types
In a couple of cases, we use `glval<unknown>` as the result type of an instruction because we can't come up with anything better. Two examples are the result of `VariableAddress[#ellipsis]`, and the address of the temp variable that holds the lvalue result of the conditional operator in `(a ? b : c) = y`. In both cases, we call `getTypeForGLValue(any(UnknownType t))`, but that would have multiple results because `result.hasType(any(UnknownType t), true)` also holds for `CppFunctionGLValueType`. I tightened the result type to ensure we get the right one.
This commit is contained in:
@@ -362,7 +362,7 @@ CppType getTypeForPRValueOrUnknown(Type type) {
|
|||||||
/**
|
/**
|
||||||
* Gets the `CppType` that represents a glvalue of type `type`.
|
* Gets the `CppType` that represents a glvalue of type `type`.
|
||||||
*/
|
*/
|
||||||
CppType getTypeForGLValue(Type type) { result.hasType(type, true) }
|
CppGLValueAddressType getTypeForGLValue(Type type) { result.hasType(type, true) }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the `CppType` that represents a prvalue of type `int`.
|
* Gets the `CppType` that represents a prvalue of type `int`.
|
||||||
|
|||||||
Reference in New Issue
Block a user