mirror of
https://github.com/github/codeql.git
synced 2026-05-03 04:39:29 +02:00
C++: Tidy up long comments that attach to items
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
import cpp
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* In rare cases, the same node is used in multiple control-flow scopes. This
|
||||
* confuses the dominance analysis, so this predicate is used to exclude them.
|
||||
*/
|
||||
|
||||
@@ -9,23 +9,28 @@ import Padding
|
||||
|
||||
/*
|
||||
* Sanity-check: Find discrepancies between computed and actual size on LP64.
|
||||
*
|
||||
from Type t, LP64 a, int padded, int bit, int real, MemberVariable v
|
||||
where padded = a.paddedSize(t) and bit = a.bitSize(t)
|
||||
and real = t.getSize() * 8 and padded != real and count(t.getSize()) = 1
|
||||
select t, a.paddedSize(t) as Padded, real, v, t.(PaddedType).memberSize(v, a)
|
||||
/** /
|
||||
*/
|
||||
|
||||
/*
|
||||
* from Type t, LP64 a, int padded, int bit, int real, MemberVariable v
|
||||
* where padded = a.paddedSize(t) and bit = a.bitSize(t)
|
||||
* and real = t.getSize() * 8 and padded != real and count(t.getSize()) = 1
|
||||
* select t, a.paddedSize(t) as Padded, real, v, t.(PaddedType).memberSize(v, a)
|
||||
*/
|
||||
|
||||
/*
|
||||
* from PaddedType t, LP64 a, MemberVariable v
|
||||
* where t instanceof Union and v = t.getAMember() and not exists(t.memberSize(v, a))
|
||||
* select t, v, v.getType().explain()
|
||||
*/
|
||||
|
||||
/*
|
||||
* from PaddedType t, LP64 a, MemberVariable v
|
||||
* where not exists(a.paddedSize(t))
|
||||
* select t, t.fieldIndex(v) as i, v, t.memberSize(v, a) order by t, i
|
||||
*/
|
||||
|
||||
from PaddedType t, LP64 a, MemberVariable v
|
||||
where t instanceof Union and v = t.getAMember() and not exists(t.memberSize(v, a))
|
||||
select t, v, v.getType().explain()
|
||||
/**
|
||||
from PaddedType t, LP64 a, MemberVariable v
|
||||
where not exists(a.paddedSize(t))
|
||||
select t, t.fieldIndex(v) as i, v, t.memberSize(v, a) order by t, i
|
||||
/**/
|
||||
from PaddedType t, LP64 a
|
||||
where a.wastedSpace(t) != 0
|
||||
select t, a.paddedSize(t) as size, a.wastedSpace(t) as waste order by waste desc
|
||||
/**/
|
||||
|
||||
|
||||
@@ -375,7 +375,7 @@ predicate flowFromCompound(Element parent, string label, Element dest)
|
||||
//
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* The values stored in src point to the compounds (destParent, destLabel).
|
||||
*/
|
||||
predicate pointerToCompound(Element destParent, string destLabel, Element src)
|
||||
@@ -624,7 +624,7 @@ predicate setlocations(int set, @element location)
|
||||
|
||||
class PointsToExpr extends Expr
|
||||
{
|
||||
/*
|
||||
/**
|
||||
* This predicate is empty by default. It should be overridden and defined to
|
||||
* include just those expressions for which points-to information is desired.
|
||||
*/
|
||||
@@ -645,10 +645,8 @@ class PointsToExpr extends Expr
|
||||
float confidence() { result = 1.0 / count(this.pointsTo()) }
|
||||
}
|
||||
|
||||
/*
|
||||
* This is used above in a `pragma[noopt]` context, which prevents its
|
||||
* customary inlining. We materialise it explicitly here.
|
||||
*/
|
||||
// This is used above in a `pragma[noopt]` context, which prevents its
|
||||
// customary inlining. We materialise it explicitly here.
|
||||
private @element localUnresolveElement(Element e) {
|
||||
result = unresolveElement(e)
|
||||
}
|
||||
|
||||
@@ -356,7 +356,7 @@ private predicate mk_PointerFieldAccess(
|
||||
qualifier = globalValueNumber(access.getQualifier().getFullyConverted())
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* `obj->field` is equivalent to `(*obj).field`, so we need to wrap an
|
||||
* extra `GVN_Deref` around the qualifier.
|
||||
*/
|
||||
|
||||
@@ -579,7 +579,7 @@ private predicate mk_ArgConsInner(HashCons head, HC_Args tail, int i, HC_Args li
|
||||
mk_ArgCons(head, i, tail, c)
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* The 0th argument of an allocator call in a new expression is always an error expression;
|
||||
* this works around it
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user