mirror of
https://github.com/github/codeql.git
synced 2026-02-08 11:11:06 +01:00
Fix up NoneCall
In some contexts, `none()` is a formula. This means in general we cannot assume `Call` is an `Expr`, but only know that it's an `AstNode`.
This commit is contained in:
@@ -369,7 +369,7 @@ class NewTypeBranch extends TNewTypeBranch, AstNode {
|
||||
override NewType getParent() { result.getABranch() = this }
|
||||
}
|
||||
|
||||
class Call extends TCall, Expr {
|
||||
class Call extends TCall, AstNode {
|
||||
Expr getArgument(int i) {
|
||||
none() // overriden in sublcasses.
|
||||
}
|
||||
@@ -425,7 +425,7 @@ class MemberCall extends TMemberCall, Call {
|
||||
Expr getBase() { toGenerated(result) = expr.getChild(0) }
|
||||
}
|
||||
|
||||
class NoneCall extends TNoneCall, Call {
|
||||
class NoneCall extends TNoneCall, Call, Formula {
|
||||
Generated::SpecialCall call;
|
||||
|
||||
NoneCall() { this = TNoneCall(call) }
|
||||
|
||||
@@ -49,7 +49,7 @@ newtype TAstNode =
|
||||
|
||||
class TFormula =
|
||||
TDisjunction or TConjunction or TComparisonFormula or TQuantifier or TNegation or TIfFormula or
|
||||
TImplication or TInstanceOf;
|
||||
TImplication or TInstanceOf or TNoneCall or TAnyCall;
|
||||
|
||||
class TBinOpExpr = TAddExpr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user