From 16cf439f6b829aa29f75d2aaeb0428d957a8fffa Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Thu, 27 May 2021 22:21:09 +0000 Subject: [PATCH] run the query on our on code, and fix an error --- ql/src/codeql_ql/ast/Ast.qll | 2 +- ql/test/printAst/printAst.expected | 64 +++++++++++++++--------------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/ql/src/codeql_ql/ast/Ast.qll b/ql/src/codeql_ql/ast/Ast.qll index b615ec026eb..f635d94c065 100644 --- a/ql/src/codeql_ql/ast/Ast.qll +++ b/ql/src/codeql_ql/ast/Ast.qll @@ -203,7 +203,7 @@ class TypeExpr extends TType, AstNode { TypeExpr() { this = TType(type) } - override string getAPrimaryQlClass() { result = "Type" } + override string getAPrimaryQlClass() { result = "TypeExpr" } /** * Gets the class name for the type. diff --git a/ql/test/printAst/printAst.expected b/ql/test/printAst/printAst.expected index 0f58abbac13..3e0e78d3b74 100644 --- a/ql/test/printAst/printAst.expected +++ b/ql/test/printAst/printAst.expected @@ -5,8 +5,8 @@ nodes | Foo.qll:1:1:25:2 | TopLevel | semmle.order | 1 | | Foo.qll:3:1:7:1 | Class | semmle.label | [Class] Class | | Foo.qll:3:1:7:1 | Class | semmle.order | 3 | -| Foo.qll:3:19:3:22 | Type | semmle.label | [Type] Type | -| Foo.qll:3:19:3:22 | Type | semmle.order | 4 | +| Foo.qll:3:19:3:22 | TypeExpr | semmle.label | [TypeExpr] TypeExpr | +| Foo.qll:3:19:3:22 | TypeExpr | semmle.order | 4 | | Foo.qll:4:3:4:17 | CharPred | semmle.label | [CharPred] CharPred | | Foo.qll:4:3:4:17 | CharPred | semmle.order | 5 | | Foo.qll:4:11:4:11 | Integer | semmle.label | [Integer] Integer | @@ -17,8 +17,8 @@ nodes | Foo.qll:4:13:4:13 | ComparisonOp | semmle.order | 8 | | Foo.qll:4:15:4:15 | Integer | semmle.label | [Integer] Integer | | Foo.qll:4:15:4:15 | Integer | semmle.order | 9 | -| Foo.qll:6:3:6:8 | Type | semmle.label | [Type] Type | -| Foo.qll:6:3:6:8 | Type | semmle.order | 10 | +| Foo.qll:6:3:6:8 | TypeExpr | semmle.label | [TypeExpr] TypeExpr | +| Foo.qll:6:3:6:8 | TypeExpr | semmle.order | 10 | | Foo.qll:6:3:6:38 | ClassPredicate | semmle.label | [ClassPredicate] ClassPredicate | | Foo.qll:6:3:6:38 | ClassPredicate | semmle.order | 10 | | Foo.qll:6:23:6:28 | Identifier | semmle.label | [Identifier] Identifier | @@ -31,8 +31,8 @@ nodes | Foo.qll:6:32:6:36 | String | semmle.order | 15 | | Foo.qll:9:7:11:1 | ClasslessPredicate | semmle.label | [ClasslessPredicate] ClasslessPredicate | | Foo.qll:9:7:11:1 | ClasslessPredicate | semmle.order | 16 | -| Foo.qll:9:21:9:23 | Type | semmle.label | [Type] Type | -| Foo.qll:9:21:9:23 | Type | semmle.order | 17 | +| Foo.qll:9:21:9:23 | TypeExpr | semmle.label | [TypeExpr] TypeExpr | +| Foo.qll:9:21:9:23 | TypeExpr | semmle.order | 17 | | Foo.qll:9:21:9:25 | VarDecl | semmle.label | [VarDecl] VarDecl | | Foo.qll:9:21:9:25 | VarDecl | semmle.order | 17 | | Foo.qll:10:3:10:3 | Identifier | semmle.label | [Identifier] Identifier | @@ -45,8 +45,8 @@ nodes | Foo.qll:10:7:10:85 | Rank | semmle.order | 22 | | Foo.qll:10:12:10:12 | Integer | semmle.label | [Integer] Integer | | Foo.qll:10:12:10:12 | Integer | semmle.order | 23 | -| Foo.qll:10:15:10:17 | Type | semmle.label | [Type] Type | -| Foo.qll:10:15:10:17 | Type | semmle.order | 24 | +| Foo.qll:10:15:10:17 | TypeExpr | semmle.label | [TypeExpr] TypeExpr | +| Foo.qll:10:15:10:17 | TypeExpr | semmle.order | 24 | | Foo.qll:10:15:10:23 | VarDecl | semmle.label | [VarDecl] VarDecl | | Foo.qll:10:15:10:23 | VarDecl | semmle.order | 24 | | Foo.qll:10:27:10:31 | Identifier | semmle.label | [Identifier] Identifier | @@ -69,8 +69,8 @@ nodes | Foo.qll:10:69:10:84 | MemberCall | semmle.order | 33 | | Foo.qll:13:1:25:1 | ClasslessPredicate | semmle.label | [ClasslessPredicate] ClasslessPredicate | | Foo.qll:13:1:25:1 | ClasslessPredicate | semmle.order | 35 | -| Foo.qll:13:17:13:19 | Type | semmle.label | [Type] Type | -| Foo.qll:13:17:13:19 | Type | semmle.order | 36 | +| Foo.qll:13:17:13:19 | TypeExpr | semmle.label | [TypeExpr] TypeExpr | +| Foo.qll:13:17:13:19 | TypeExpr | semmle.order | 36 | | Foo.qll:13:17:13:21 | VarDecl | semmle.label | [VarDecl] VarDecl | | Foo.qll:13:17:13:21 | VarDecl | semmle.order | 36 | | Foo.qll:14:3:14:10 | PredicateCall | semmle.label | [PredicateCall] PredicateCall | @@ -111,8 +111,8 @@ nodes | Foo.qll:18:3:18:20 | MemberCall | semmle.order | 53 | | Foo.qll:18:3:18:28 | ComparisonFormula | semmle.label | [ComparisonFormula] ComparisonFormula | | Foo.qll:18:3:18:28 | ComparisonFormula | semmle.order | 53 | -| Foo.qll:18:6:18:8 | Type | semmle.label | [Type] Type | -| Foo.qll:18:6:18:8 | Type | semmle.order | 57 | +| Foo.qll:18:6:18:8 | TypeExpr | semmle.label | [TypeExpr] TypeExpr | +| Foo.qll:18:6:18:8 | TypeExpr | semmle.order | 57 | | Foo.qll:18:22:18:22 | ComparisonOp | semmle.label | [ComparisonOp] ComparisonOp | | Foo.qll:18:22:18:22 | ComparisonOp | semmle.order | 58 | | Foo.qll:18:24:18:28 | String | semmle.label | [String] String | @@ -123,8 +123,8 @@ nodes | Foo.qll:20:3:20:9 | InlineCast | semmle.order | 60 | | Foo.qll:20:3:20:13 | ComparisonFormula | semmle.label | [ComparisonFormula] ComparisonFormula | | Foo.qll:20:3:20:13 | ComparisonFormula | semmle.order | 60 | -| Foo.qll:20:6:20:8 | Type | semmle.label | [Type] Type | -| Foo.qll:20:6:20:8 | Type | semmle.order | 63 | +| Foo.qll:20:6:20:8 | TypeExpr | semmle.label | [TypeExpr] TypeExpr | +| Foo.qll:20:6:20:8 | TypeExpr | semmle.order | 63 | | Foo.qll:20:11:20:11 | ComparisonOp | semmle.label | [ComparisonOp] ComparisonOp | | Foo.qll:20:11:20:11 | ComparisonOp | semmle.order | 64 | | Foo.qll:20:13:20:13 | Identifier | semmle.label | [Identifier] Identifier | @@ -137,8 +137,8 @@ nodes | Foo.qll:22:5:22:5 | ComparisonOp | semmle.order | 68 | | Foo.qll:22:7:22:16 | Aggregate[any] | semmle.label | [Aggregate[any]] Aggregate[any] | | Foo.qll:22:7:22:16 | Aggregate[any] | semmle.order | 69 | -| Foo.qll:22:11:22:13 | Type | semmle.label | [Type] Type | -| Foo.qll:22:11:22:13 | Type | semmle.order | 70 | +| Foo.qll:22:11:22:13 | TypeExpr | semmle.label | [TypeExpr] TypeExpr | +| Foo.qll:22:11:22:13 | TypeExpr | semmle.order | 70 | | Foo.qll:22:11:22:15 | VarDecl | semmle.label | [VarDecl] VarDecl | | Foo.qll:22:11:22:15 | VarDecl | semmle.order | 70 | | Foo.qll:24:7:24:11 | AnyCall | semmle.label | [AnyCall] AnyCall | @@ -156,8 +156,8 @@ edges | Foo.qll:1:1:25:2 | TopLevel | Foo.qll:9:7:11:1 | ClasslessPredicate | semmle.order | 16 | | Foo.qll:1:1:25:2 | TopLevel | Foo.qll:13:1:25:1 | ClasslessPredicate | semmle.label | 4 | | Foo.qll:1:1:25:2 | TopLevel | Foo.qll:13:1:25:1 | ClasslessPredicate | semmle.order | 35 | -| Foo.qll:3:1:7:1 | Class | Foo.qll:3:19:3:22 | Type | semmle.label | 1 | -| Foo.qll:3:1:7:1 | Class | Foo.qll:3:19:3:22 | Type | semmle.order | 4 | +| Foo.qll:3:1:7:1 | Class | Foo.qll:3:19:3:22 | TypeExpr | semmle.label | 1 | +| Foo.qll:3:1:7:1 | Class | Foo.qll:3:19:3:22 | TypeExpr | semmle.order | 4 | | Foo.qll:3:1:7:1 | Class | Foo.qll:4:3:4:17 | CharPred | semmle.label | 2 | | Foo.qll:3:1:7:1 | Class | Foo.qll:4:3:4:17 | CharPred | semmle.order | 5 | | Foo.qll:3:1:7:1 | Class | Foo.qll:6:3:6:38 | ClassPredicate | semmle.label | 3 | @@ -170,8 +170,8 @@ edges | Foo.qll:4:11:4:15 | ComparisonFormula | Foo.qll:4:13:4:13 | ComparisonOp | semmle.order | 8 | | Foo.qll:4:11:4:15 | ComparisonFormula | Foo.qll:4:15:4:15 | Integer | semmle.label | 3 | | Foo.qll:4:11:4:15 | ComparisonFormula | Foo.qll:4:15:4:15 | Integer | semmle.order | 9 | -| Foo.qll:6:3:6:38 | ClassPredicate | Foo.qll:6:3:6:8 | Type | semmle.label | 1 | -| Foo.qll:6:3:6:38 | ClassPredicate | Foo.qll:6:3:6:8 | Type | semmle.order | 10 | +| Foo.qll:6:3:6:38 | ClassPredicate | Foo.qll:6:3:6:8 | TypeExpr | semmle.label | 1 | +| Foo.qll:6:3:6:38 | ClassPredicate | Foo.qll:6:3:6:8 | TypeExpr | semmle.order | 10 | | Foo.qll:6:3:6:38 | ClassPredicate | Foo.qll:6:23:6:36 | ComparisonFormula | semmle.label | 2 | | Foo.qll:6:3:6:38 | ClassPredicate | Foo.qll:6:23:6:36 | ComparisonFormula | semmle.order | 12 | | Foo.qll:6:23:6:36 | ComparisonFormula | Foo.qll:6:23:6:28 | Identifier | semmle.label | 1 | @@ -184,8 +184,8 @@ edges | Foo.qll:9:7:11:1 | ClasslessPredicate | Foo.qll:9:21:9:25 | VarDecl | semmle.order | 17 | | Foo.qll:9:7:11:1 | ClasslessPredicate | Foo.qll:10:3:10:85 | ComparisonFormula | semmle.label | 2 | | Foo.qll:9:7:11:1 | ClasslessPredicate | Foo.qll:10:3:10:85 | ComparisonFormula | semmle.order | 19 | -| Foo.qll:9:21:9:25 | VarDecl | Foo.qll:9:21:9:23 | Type | semmle.label | 1 | -| Foo.qll:9:21:9:25 | VarDecl | Foo.qll:9:21:9:23 | Type | semmle.order | 17 | +| Foo.qll:9:21:9:25 | VarDecl | Foo.qll:9:21:9:23 | TypeExpr | semmle.label | 1 | +| Foo.qll:9:21:9:25 | VarDecl | Foo.qll:9:21:9:23 | TypeExpr | semmle.order | 17 | | Foo.qll:10:3:10:85 | ComparisonFormula | Foo.qll:10:3:10:3 | Identifier | semmle.label | 1 | | Foo.qll:10:3:10:85 | ComparisonFormula | Foo.qll:10:3:10:3 | Identifier | semmle.order | 19 | | Foo.qll:10:3:10:85 | ComparisonFormula | Foo.qll:10:5:10:5 | ComparisonOp | semmle.label | 2 | @@ -202,8 +202,8 @@ edges | Foo.qll:10:7:10:85 | Rank | Foo.qll:10:54:10:58 | AsExpr | semmle.order | 31 | | Foo.qll:10:7:10:85 | Rank | Foo.qll:10:69:10:84 | MemberCall | semmle.label | 5 | | Foo.qll:10:7:10:85 | Rank | Foo.qll:10:69:10:84 | MemberCall | semmle.order | 33 | -| Foo.qll:10:15:10:23 | VarDecl | Foo.qll:10:15:10:17 | Type | semmle.label | 1 | -| Foo.qll:10:15:10:23 | VarDecl | Foo.qll:10:15:10:17 | Type | semmle.order | 24 | +| Foo.qll:10:15:10:23 | VarDecl | Foo.qll:10:15:10:17 | TypeExpr | semmle.label | 1 | +| Foo.qll:10:15:10:23 | VarDecl | Foo.qll:10:15:10:17 | TypeExpr | semmle.order | 24 | | Foo.qll:10:27:10:42 | MemberCall | Foo.qll:10:27:10:31 | Identifier | semmle.label | 1 | | Foo.qll:10:27:10:42 | MemberCall | Foo.qll:10:27:10:31 | Identifier | semmle.order | 26 | | Foo.qll:10:27:10:50 | ComparisonFormula | Foo.qll:10:27:10:42 | MemberCall | semmle.label | 1 | @@ -220,8 +220,8 @@ edges | Foo.qll:13:1:25:1 | ClasslessPredicate | Foo.qll:13:17:13:21 | VarDecl | semmle.order | 36 | | Foo.qll:13:1:25:1 | ClasslessPredicate | Foo.qll:14:3:24:15 | Disjunction | semmle.label | 2 | | Foo.qll:13:1:25:1 | ClasslessPredicate | Foo.qll:14:3:24:15 | Disjunction | semmle.order | 38 | -| Foo.qll:13:17:13:21 | VarDecl | Foo.qll:13:17:13:19 | Type | semmle.label | 1 | -| Foo.qll:13:17:13:21 | VarDecl | Foo.qll:13:17:13:19 | Type | semmle.order | 36 | +| Foo.qll:13:17:13:21 | VarDecl | Foo.qll:13:17:13:19 | TypeExpr | semmle.label | 1 | +| Foo.qll:13:17:13:21 | VarDecl | Foo.qll:13:17:13:19 | TypeExpr | semmle.order | 36 | | Foo.qll:14:3:14:10 | PredicateCall | Foo.qll:14:9:14:9 | Identifier | semmle.label | 1 | | Foo.qll:14:3:14:10 | PredicateCall | Foo.qll:14:9:14:9 | Identifier | semmle.order | 44 | | Foo.qll:14:3:16:29 | Disjunction | Foo.qll:14:3:14:10 | PredicateCall | semmle.label | 1 | @@ -260,8 +260,8 @@ edges | Foo.qll:16:11:16:29 | MemberCall | Foo.qll:16:28:16:28 | Integer | semmle.order | 52 | | Foo.qll:18:3:18:9 | InlineCast | Foo.qll:18:3:18:3 | Identifier | semmle.label | 1 | | Foo.qll:18:3:18:9 | InlineCast | Foo.qll:18:3:18:3 | Identifier | semmle.order | 53 | -| Foo.qll:18:3:18:9 | InlineCast | Foo.qll:18:6:18:8 | Type | semmle.label | 2 | -| Foo.qll:18:3:18:9 | InlineCast | Foo.qll:18:6:18:8 | Type | semmle.order | 57 | +| Foo.qll:18:3:18:9 | InlineCast | Foo.qll:18:6:18:8 | TypeExpr | semmle.label | 2 | +| Foo.qll:18:3:18:9 | InlineCast | Foo.qll:18:6:18:8 | TypeExpr | semmle.order | 57 | | Foo.qll:18:3:18:20 | MemberCall | Foo.qll:18:3:18:9 | InlineCast | semmle.label | 1 | | Foo.qll:18:3:18:20 | MemberCall | Foo.qll:18:3:18:9 | InlineCast | semmle.order | 53 | | Foo.qll:18:3:18:28 | ComparisonFormula | Foo.qll:18:3:18:20 | MemberCall | semmle.label | 1 | @@ -272,8 +272,8 @@ edges | Foo.qll:18:3:18:28 | ComparisonFormula | Foo.qll:18:24:18:28 | String | semmle.order | 59 | | Foo.qll:20:3:20:9 | InlineCast | Foo.qll:20:3:20:3 | Identifier | semmle.label | 1 | | Foo.qll:20:3:20:9 | InlineCast | Foo.qll:20:3:20:3 | Identifier | semmle.order | 60 | -| Foo.qll:20:3:20:9 | InlineCast | Foo.qll:20:6:20:8 | Type | semmle.label | 2 | -| Foo.qll:20:3:20:9 | InlineCast | Foo.qll:20:6:20:8 | Type | semmle.order | 63 | +| Foo.qll:20:3:20:9 | InlineCast | Foo.qll:20:6:20:8 | TypeExpr | semmle.label | 2 | +| Foo.qll:20:3:20:9 | InlineCast | Foo.qll:20:6:20:8 | TypeExpr | semmle.order | 63 | | Foo.qll:20:3:20:13 | ComparisonFormula | Foo.qll:20:3:20:9 | InlineCast | semmle.label | 1 | | Foo.qll:20:3:20:13 | ComparisonFormula | Foo.qll:20:3:20:9 | InlineCast | semmle.order | 60 | | Foo.qll:20:3:20:13 | ComparisonFormula | Foo.qll:20:11:20:11 | ComparisonOp | semmle.label | 2 | @@ -288,8 +288,8 @@ edges | Foo.qll:22:3:22:16 | ComparisonFormula | Foo.qll:22:7:22:16 | Aggregate[any] | semmle.order | 69 | | Foo.qll:22:7:22:16 | Aggregate[any] | Foo.qll:22:11:22:15 | VarDecl | semmle.label | 1 | | Foo.qll:22:7:22:16 | Aggregate[any] | Foo.qll:22:11:22:15 | VarDecl | semmle.order | 70 | -| Foo.qll:22:11:22:15 | VarDecl | Foo.qll:22:11:22:13 | Type | semmle.label | 1 | -| Foo.qll:22:11:22:15 | VarDecl | Foo.qll:22:11:22:13 | Type | semmle.order | 70 | +| Foo.qll:22:11:22:15 | VarDecl | Foo.qll:22:11:22:13 | TypeExpr | semmle.label | 1 | +| Foo.qll:22:11:22:15 | VarDecl | Foo.qll:22:11:22:13 | TypeExpr | semmle.order | 70 | | printAst.ql:1:1:1:29 | TopLevel | printAst.ql:1:1:1:28 | Import | semmle.label | 1 | | printAst.ql:1:1:1:29 | TopLevel | printAst.ql:1:1:1:28 | Import | semmle.order | 73 | graphProperties