mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Merge pull request #1343 from rdmarsh2/rdmarsh/cpp/getUnspecifiedType
C++: add getUnspecifiedType() for exprs and decls
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import cpp
|
||||
|
||||
from Variable v
|
||||
select v, v.getType().getUnspecifiedType()
|
||||
select v, v.getUnspecifiedType()
|
||||
|
||||
@@ -7,5 +7,5 @@ import cpp
|
||||
|
||||
from ArrayAggregateLiteral aal, int childIndex, int elementIndex
|
||||
where aal.getElementExpr(elementIndex) = aal.getChild(childIndex)
|
||||
select aal, aal.getType().getUnspecifiedType(), childIndex,
|
||||
select aal, aal.getUnspecifiedType(), childIndex,
|
||||
aal.getChild(childIndex), elementIndex
|
||||
|
||||
@@ -7,4 +7,4 @@ import cpp
|
||||
|
||||
from ClassAggregateLiteral cal, int i, Field f
|
||||
where cal.getFieldExpr(f) = cal.getChild(i)
|
||||
select cal, cal.getType().getUnspecifiedType(), i, cal.getChild(i), f
|
||||
select cal, cal.getUnspecifiedType(), i, cal.getChild(i), f
|
||||
|
||||
@@ -6,7 +6,7 @@ import cpp
|
||||
|
||||
from AnalysedString s, string str
|
||||
where
|
||||
if s.(StringLiteral).getType().getUnspecifiedType().(DerivedType).getBaseType() instanceof Wchar_t then (
|
||||
if s.(StringLiteral).getUnspecifiedType().(DerivedType).getBaseType() instanceof Wchar_t then (
|
||||
str = "[?]"
|
||||
) else (
|
||||
str = s.toString()
|
||||
|
||||
@@ -3,5 +3,5 @@ import cpp
|
||||
from Variable v
|
||||
select v,
|
||||
v.getType().explain(),
|
||||
v.getType().getUnspecifiedType().explain()
|
||||
v.getUnspecifiedType().explain()
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ import cpp
|
||||
from ArrayExpr arrayExpr
|
||||
select
|
||||
arrayExpr,
|
||||
arrayExpr.getArrayBase().getType().getUnspecifiedType().toString() +
|
||||
arrayExpr.getArrayBase().getUnspecifiedType().toString() +
|
||||
", " +
|
||||
arrayExpr.getArrayBase().getFullyConverted().getType().getUnspecifiedType().toString() +
|
||||
arrayExpr.getArrayBase().getFullyConverted().getUnspecifiedType().toString() +
|
||||
", " +
|
||||
arrayExpr.getType().getUnspecifiedType().toString()
|
||||
arrayExpr.getUnspecifiedType().toString()
|
||||
|
||||
Reference in New Issue
Block a user