C++: respond to PR comments

This commit is contained in:
Robert Marsh
2019-05-28 07:51:59 -07:00
parent 2dd1c06409
commit d20efe49dd
4 changed files with 4 additions and 8 deletions

View File

@@ -25,7 +25,7 @@ class InvalidFloatCastExpr extends Expr {
InvalidFloatCastExpr() {
exists(Type src, Type dst |
src = this.getUnspecifiedType() and
dst = this.getActualType().getUnspecifiedType() and
dst = this.getFullyConverted().getUnspecifiedType() and
src.(GeneralPointerType).getBaseType() instanceof FloatingPointType and
src.(GeneralPointerType).getBaseType() != dst.(GeneralPointerType).getBaseType()
)

View File

@@ -20,7 +20,7 @@ class NullPointer extends Expr {
from Expr e, Type t1, Type t2
where t1 = e.getUnspecifiedType() and
t2 = e.getActualType().getUnspecifiedType() and
t2 = e.getFullyConverted().getUnspecifiedType() and
t1 != t2 and
(t1 instanceof PointerType or t2 instanceof PointerType) and
not (t2 instanceof VoidPointerType and t1 instanceof PointerType) and

View File

@@ -271,7 +271,7 @@ abstract class DeclarationEntry extends Locatable {
abstract Type getType();
/**
* Gets the type associated with this declaration entrry after specifiers
* Gets the type associated with this declaration entry after specifiers
* have been deeply stripped and typedefs have been resolved.
*
* For variable declarations, get the type of the variable.

View File

@@ -71,10 +71,6 @@ class Expr extends StmtParent, @expr {
/**
* Gets the type of this expression after specifiers have been deeply
* stripped and typedefs have been resolved.
*
* In most cases, this predicate will be the same as getType(). It will
* only differ when the result of getType() is a TypedefType, in which
* case this predicate will (possibly recursively) resolve the typedef.
*/
Type getUnspecifiedType() { result = this.getType().getUnspecifiedType() }
@@ -225,7 +221,7 @@ class Expr extends StmtParent, @expr {
exists ( Expr e2 |
e.(TypeidOperator).getExpr() = e2 and
(
not e2.getActualType().getUnspecifiedType().(Class).isPolymorphic() or
not e2.getFullyConverted().getUnspecifiedType().(Class).isPolymorphic() or
not e2.isGLValueCategory()
)
) or