mirror of
https://github.com/github/codeql.git
synced 2026-01-09 12:40:25 +01:00
Merge branch 'main' into js/shared-dataflow-merge-main
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.5
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
3
shared/controlflow/change-notes/released/1.0.6.md
Normal file
3
shared/controlflow/change-notes/released/1.0.6.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/controlflow/change-notes/released/1.0.7.md
Normal file
3
shared/controlflow/change-notes/released/1.0.7.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/controlflow/change-notes/released/1.0.8.md
Normal file
3
shared/controlflow/change-notes/released/1.0.8.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
lastReleaseVersion: 1.0.5
|
||||
lastReleaseVersion: 1.0.8
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: codeql/controlflow
|
||||
version: 1.0.6-dev
|
||||
version: 1.0.9-dev
|
||||
groups: shared
|
||||
library: true
|
||||
dependencies:
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
## 1.1.2
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.1.1
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.1.0
|
||||
|
||||
### Deprecated APIs
|
||||
|
||||
* The source/sink grouping feature of the data flow library has been removed. It was introduced primarily for debugging, but has not proven useful.
|
||||
|
||||
## 1.0.5
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
category: deprecated
|
||||
---
|
||||
## 1.1.0
|
||||
|
||||
### Deprecated APIs
|
||||
|
||||
* The source/sink grouping feature of the data flow library has been removed. It was introduced primarily for debugging, but has not proven useful.
|
||||
3
shared/dataflow/change-notes/released/1.1.1.md
Normal file
3
shared/dataflow/change-notes/released/1.1.1.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.1.1
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/dataflow/change-notes/released/1.1.2.md
Normal file
3
shared/dataflow/change-notes/released/1.1.2.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.1.2
|
||||
|
||||
No user-facing changes.
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
lastReleaseVersion: 1.0.5
|
||||
lastReleaseVersion: 1.1.2
|
||||
|
||||
@@ -298,7 +298,7 @@ signature module InputSig<LocationSig Location> {
|
||||
/** Extra data-flow steps needed for lambda flow analysis. */
|
||||
predicate additionalLambdaFlowStep(Node nodeFrom, Node nodeTo, boolean preservesValue);
|
||||
|
||||
predicate knownSourceModel(Node sink, string model);
|
||||
predicate knownSourceModel(Node source, string model);
|
||||
|
||||
predicate knownSinkModel(Node sink, string model);
|
||||
|
||||
|
||||
@@ -585,11 +585,13 @@ module Flow<LocationSig Location, InputSig<Location> Input> implements OutputSig
|
||||
2 <= strictcount(CapturedVariable v | captureAccess(v, c))
|
||||
or
|
||||
// Constructors that capture a variable may assign it to a field, which also
|
||||
// entails a this-to-this summary.
|
||||
captureAccess(_, c) and c.isConstructor()
|
||||
// entails a this-to-this summary. If there are multiple constructors, then
|
||||
// they might call each other, so if one constructor captures a variable we
|
||||
// allow this-to-this summaries for all of them.
|
||||
exists(ClosureExpr ce | ce.hasBody(c) and c.isConstructor() and hasConstructorCapture(ce, _))
|
||||
}
|
||||
|
||||
/** Holds if the constructor, if any, for the closure defined by `ce` captures `v`. */
|
||||
/** Holds if a constructor, if any, for the closure defined by `ce` captures `v`. */
|
||||
private predicate hasConstructorCapture(ClosureExpr ce, CapturedVariable v) {
|
||||
exists(Callable c | ce.hasBody(c) and c.isConstructor() and captureAccess(v, c))
|
||||
}
|
||||
|
||||
@@ -104,8 +104,6 @@ module MakeImplContentDataFlow<LocationSig Location, InputSig<Location> Lang> {
|
||||
additionalStep(node1, state1, node2, state2)
|
||||
}
|
||||
|
||||
predicate isAdditionalFlowStep = ContentConfig::isAdditionalFlowStep/2;
|
||||
|
||||
predicate isBarrier = ContentConfig::isBarrier/1;
|
||||
|
||||
FlowFeature getAFeature() { result = ContentConfig::getAFeature() }
|
||||
@@ -302,12 +300,16 @@ module MakeImplContentDataFlow<LocationSig Location, InputSig<Location> Lang> {
|
||||
// relation, when flow can reach a sink without going back out
|
||||
Flow::PathGraph::subpaths(pred, succ, _, _) and
|
||||
not reachesSink(succ)
|
||||
or
|
||||
)
|
||||
or
|
||||
exists(Node predNode, State predState, Node succNode, State succState |
|
||||
succNodeAndState(pred, predNode, predState, succ, succNode, succState)
|
||||
|
|
||||
// needed to record store steps
|
||||
storeStep(pred.getNode(), pred.getState(), _, succ.getNode(), succ.getState())
|
||||
storeStep(predNode, predState, _, succNode, succState)
|
||||
or
|
||||
// needed to record read steps
|
||||
readStep(pred.getNode(), pred.getState(), _, succ.getNode(), succ.getState())
|
||||
readStep(predNode, predState, _, succNode, succState)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -455,27 +457,39 @@ module MakeImplContentDataFlow<LocationSig Location, InputSig<Location> Lang> {
|
||||
)
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
private predicate succNodeAndState(
|
||||
Flow::PathNode pre, Node preNode, State preState, Flow::PathNode succ, Node succNode,
|
||||
State succState
|
||||
) {
|
||||
pre.getNode() = preNode and
|
||||
pre.getState() = preState and
|
||||
succ.getNode() = succNode and
|
||||
succ.getState() = succState and
|
||||
pre.getASuccessor() = succ
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
private predicate nodeReachesStore(
|
||||
Flow::PathNode source, AccessPath scReads, AccessPath scStores, Flow::PathNode node,
|
||||
Flow::PathNode source, AccessPath scReads, AccessPath scStores, Flow::PathNode target,
|
||||
ContentSet c, AccessPath reads, AccessPath stores
|
||||
) {
|
||||
exists(Flow::PathNode mid |
|
||||
exists(Flow::PathNode mid, State midState, Node midNode, State targetState, Node targetNode |
|
||||
nodeReaches(source, scReads, scStores, mid, reads, stores) and
|
||||
storeStep(mid.getNode(), mid.getState(), c, node.getNode(), node.getState()) and
|
||||
mid.getASuccessor() = node
|
||||
succNodeAndState(mid, midNode, midState, target, targetNode, targetState) and
|
||||
storeStep(midNode, midState, c, targetNode, targetState)
|
||||
)
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
private predicate nodeReachesRead(
|
||||
Flow::PathNode source, AccessPath scReads, AccessPath scStores, Flow::PathNode node,
|
||||
Flow::PathNode source, AccessPath scReads, AccessPath scStores, Flow::PathNode target,
|
||||
ContentSet c, AccessPath reads, AccessPath stores
|
||||
) {
|
||||
exists(Flow::PathNode mid |
|
||||
exists(Flow::PathNode mid, State midState, Node midNode, State targetState, Node targetNode |
|
||||
nodeReaches(source, scReads, scStores, mid, reads, stores) and
|
||||
readStep(mid.getNode(), mid.getState(), c, node.getNode(), node.getState()) and
|
||||
mid.getASuccessor() = node
|
||||
succNodeAndState(mid, midNode, midState, target, targetNode, targetState) and
|
||||
readStep(midNode, midState, c, targetNode, targetState)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1569,11 +1569,6 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
|
||||
TDataFlowCallNone() or
|
||||
TDataFlowCallSome(DataFlowCall call)
|
||||
|
||||
cached
|
||||
newtype TParamNodeOption =
|
||||
TParamNodeNone() or
|
||||
TParamNodeSome(ParamNode p)
|
||||
|
||||
cached
|
||||
newtype TReturnCtx =
|
||||
TReturnCtxNone() or
|
||||
@@ -2234,19 +2229,6 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
|
||||
}
|
||||
}
|
||||
|
||||
/** An optional `ParamNode`. */
|
||||
class ParamNodeOption extends TParamNodeOption {
|
||||
string toString() {
|
||||
this = TParamNodeNone() and
|
||||
result = "(none)"
|
||||
or
|
||||
exists(ParamNode p |
|
||||
this = TParamNodeSome(p) and
|
||||
result = p.toString()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A return context used to calculate flow summaries in reverse flow.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: codeql/dataflow
|
||||
version: 1.0.6-dev
|
||||
version: 1.1.3-dev
|
||||
groups: shared
|
||||
library: true
|
||||
dependencies:
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.5
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
3
shared/mad/change-notes/released/1.0.6.md
Normal file
3
shared/mad/change-notes/released/1.0.6.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/mad/change-notes/released/1.0.7.md
Normal file
3
shared/mad/change-notes/released/1.0.7.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/mad/change-notes/released/1.0.8.md
Normal file
3
shared/mad/change-notes/released/1.0.8.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
lastReleaseVersion: 1.0.5
|
||||
lastReleaseVersion: 1.0.8
|
||||
|
||||
@@ -97,6 +97,18 @@ module ModelPrintingImpl<ModelPrintingLangSig Lang> {
|
||||
result = asSummaryModel(api, input, output, "taint")
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the summary model for `api` with `input` and `output`.
|
||||
*/
|
||||
bindingset[input, output, preservesValue]
|
||||
string asModel(Printing::SummaryApi api, string input, string output, boolean preservesValue) {
|
||||
preservesValue = true and
|
||||
result = asValueModel(api, input, output)
|
||||
or
|
||||
preservesValue = false and
|
||||
result = asTaintModel(api, input, output)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sink model for `api` with `input` and `kind`.
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: codeql/mad
|
||||
version: 1.0.6-dev
|
||||
version: 1.0.9-dev
|
||||
groups: shared
|
||||
library: true
|
||||
dependencies:
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.5
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
3
shared/rangeanalysis/change-notes/released/1.0.6.md
Normal file
3
shared/rangeanalysis/change-notes/released/1.0.6.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/rangeanalysis/change-notes/released/1.0.7.md
Normal file
3
shared/rangeanalysis/change-notes/released/1.0.7.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/rangeanalysis/change-notes/released/1.0.8.md
Normal file
3
shared/rangeanalysis/change-notes/released/1.0.8.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
lastReleaseVersion: 1.0.5
|
||||
lastReleaseVersion: 1.0.8
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: codeql/rangeanalysis
|
||||
version: 1.0.6-dev
|
||||
version: 1.0.9-dev
|
||||
groups: shared
|
||||
library: true
|
||||
dependencies:
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.5
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
3
shared/regex/change-notes/released/1.0.6.md
Normal file
3
shared/regex/change-notes/released/1.0.6.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/regex/change-notes/released/1.0.7.md
Normal file
3
shared/regex/change-notes/released/1.0.7.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/regex/change-notes/released/1.0.8.md
Normal file
3
shared/regex/change-notes/released/1.0.8.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
lastReleaseVersion: 1.0.5
|
||||
lastReleaseVersion: 1.0.8
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: codeql/regex
|
||||
version: 1.0.6-dev
|
||||
version: 1.0.9-dev
|
||||
groups: shared
|
||||
library: true
|
||||
dependencies:
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.5
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
3
shared/ssa/change-notes/released/1.0.6.md
Normal file
3
shared/ssa/change-notes/released/1.0.6.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/ssa/change-notes/released/1.0.7.md
Normal file
3
shared/ssa/change-notes/released/1.0.7.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/ssa/change-notes/released/1.0.8.md
Normal file
3
shared/ssa/change-notes/released/1.0.8.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
lastReleaseVersion: 1.0.5
|
||||
lastReleaseVersion: 1.0.8
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: codeql/ssa
|
||||
version: 1.0.6-dev
|
||||
version: 1.0.9-dev
|
||||
groups: shared
|
||||
library: true
|
||||
dependencies:
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.5
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
3
shared/threat-models/change-notes/released/1.0.6.md
Normal file
3
shared/threat-models/change-notes/released/1.0.6.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/threat-models/change-notes/released/1.0.7.md
Normal file
3
shared/threat-models/change-notes/released/1.0.7.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/threat-models/change-notes/released/1.0.8.md
Normal file
3
shared/threat-models/change-notes/released/1.0.8.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
lastReleaseVersion: 1.0.5
|
||||
lastReleaseVersion: 1.0.8
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: codeql/threat-models
|
||||
version: 1.0.6-dev
|
||||
version: 1.0.9-dev
|
||||
library: true
|
||||
groups: shared
|
||||
dataExtensions:
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
load("@ruby_deps//:defs.bzl", "aliases", "all_crate_deps")
|
||||
load("@rules_rust//rust:defs.bzl", "rust_library")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
load("@tree_sitter_extractors_deps//:defs.bzl", "aliases", "all_crate_deps")
|
||||
|
||||
rust_library(
|
||||
name = "codeql-extractor",
|
||||
@@ -12,5 +10,16 @@ rust_library(
|
||||
compile_data = [
|
||||
"src/generator/prefix.dbscheme",
|
||||
],
|
||||
deps = all_crate_deps(package_name = "ruby/extractor/codeql-extractor-fake-crate"),
|
||||
deps = all_crate_deps(),
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "tree-sitter-extractor",
|
||||
actual = ":codeql-extractor",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "dbscheme-prefix",
|
||||
srcs = ["src/generator/prefix.dbscheme"],
|
||||
)
|
||||
|
||||
@@ -7,7 +7,7 @@ authors = ["GitHub"]
|
||||
[dependencies]
|
||||
flate2 = "1.0"
|
||||
globset = "0.4"
|
||||
tree-sitter = ">= 0.22.6"
|
||||
tree-sitter = ">= 0.23.0"
|
||||
tracing = "0.1"
|
||||
tracing-subscriber = { version = "0.3.3", features = ["env-filter"] }
|
||||
rayon = "1.5.0"
|
||||
@@ -24,5 +24,3 @@ tree-sitter-ql = { git = "https://github.com/tree-sitter/tree-sitter-ql" }
|
||||
tree-sitter-json = {git = "https://github.com/tree-sitter/tree-sitter-json" }
|
||||
rand = "0.8.5"
|
||||
|
||||
[patch.crates-io]
|
||||
tree-sitter = {git = "https://github.com/redsun82/tree-sitter.git", rev = "1f5c1112ceaa8fc6aff61d1852690407670d2a96"}
|
||||
|
||||
@@ -76,8 +76,8 @@ pub fn populate_empty_location(writer: &mut trap::Writer) {
|
||||
let file_label = populate_empty_file(writer);
|
||||
let loc_label = global_location(
|
||||
writer,
|
||||
file_label,
|
||||
trap::Location {
|
||||
file_label,
|
||||
start_line: 0,
|
||||
start_column: 0,
|
||||
end_line: 0,
|
||||
@@ -127,14 +127,10 @@ pub fn populate_parent_folders(
|
||||
}
|
||||
|
||||
/** Get the label for the given location, defining it a global ID if it doesn't exist yet. */
|
||||
fn global_location(
|
||||
writer: &mut trap::Writer,
|
||||
file_label: trap::Label,
|
||||
location: trap::Location,
|
||||
) -> trap::Label {
|
||||
fn global_location(writer: &mut trap::Writer, location: trap::Location) -> trap::Label {
|
||||
let (loc_label, fresh) = writer.global_id(&format!(
|
||||
"loc,{{{}}},{},{},{},{}",
|
||||
file_label,
|
||||
location.file_label,
|
||||
location.start_line,
|
||||
location.start_column,
|
||||
location.end_line,
|
||||
@@ -145,7 +141,7 @@ fn global_location(
|
||||
"locations_default",
|
||||
vec![
|
||||
trap::Arg::Label(loc_label),
|
||||
trap::Arg::Label(file_label),
|
||||
trap::Arg::Label(location.file_label),
|
||||
trap::Arg::Int(location.start_line),
|
||||
trap::Arg::Int(location.start_column),
|
||||
trap::Arg::Int(location.end_line),
|
||||
@@ -158,18 +154,14 @@ fn global_location(
|
||||
|
||||
/** Get the label for the given location, creating it as a fresh ID if we haven't seen the location
|
||||
* yet for this file. */
|
||||
fn location_label(
|
||||
writer: &mut trap::Writer,
|
||||
file_label: trap::Label,
|
||||
location: trap::Location,
|
||||
) -> trap::Label {
|
||||
pub fn location_label(writer: &mut trap::Writer, location: trap::Location) -> trap::Label {
|
||||
let (loc_label, fresh) = writer.location_label(location);
|
||||
if fresh {
|
||||
writer.add_tuple(
|
||||
"locations_default",
|
||||
vec![
|
||||
trap::Arg::Label(loc_label),
|
||||
trap::Arg::Label(file_label),
|
||||
trap::Arg::Label(location.file_label),
|
||||
trap::Arg::Int(location.start_line),
|
||||
trap::Arg::Int(location.start_column),
|
||||
trap::Arg::Int(location.end_line),
|
||||
@@ -312,8 +304,8 @@ impl<'a> Visitor<'a> {
|
||||
node: Node,
|
||||
status_page: bool,
|
||||
) {
|
||||
let loc = location_for(self, node);
|
||||
let loc_label = location_label(self.trap_writer, self.file_label, loc);
|
||||
let loc = location_for(self, self.file_label, node);
|
||||
let loc_label = location_label(self.trap_writer, loc);
|
||||
let mut mesg = self.diagnostics_writer.new_entry(
|
||||
"parse-error",
|
||||
"Could not process some files due to syntax errors",
|
||||
@@ -364,8 +356,8 @@ impl<'a> Visitor<'a> {
|
||||
return;
|
||||
}
|
||||
let (id, _, child_nodes) = self.stack.pop().expect("Vistor: empty stack");
|
||||
let loc = location_for(self, node);
|
||||
let loc_label = location_label(self.trap_writer, self.file_label, loc);
|
||||
let loc = location_for(self, self.file_label, node);
|
||||
let loc_label = location_label(self.trap_writer, loc);
|
||||
let table = self
|
||||
.schema
|
||||
.get(&TypeName {
|
||||
@@ -627,7 +619,7 @@ fn sliced_source_arg(source: &[u8], n: Node) -> trap::Arg {
|
||||
// Emit a pair of `TrapEntry`s for the provided node, appropriately calibrated.
|
||||
// The first is the location and label definition, and the second is the
|
||||
// 'Located' entry.
|
||||
fn location_for(visitor: &mut Visitor, n: Node) -> trap::Location {
|
||||
fn location_for(visitor: &mut Visitor, file_label: trap::Label, n: Node) -> trap::Location {
|
||||
// Tree-sitter row, column values are 0-based while CodeQL starts
|
||||
// counting at 1. In addition Tree-sitter's row and column for the
|
||||
// end position are exclusive while CodeQL's end positions are inclusive.
|
||||
@@ -685,6 +677,7 @@ fn location_for(visitor: &mut Visitor, n: Node) -> trap::Location {
|
||||
}
|
||||
}
|
||||
trap::Location {
|
||||
file_label,
|
||||
start_line,
|
||||
start_column,
|
||||
end_line,
|
||||
|
||||
@@ -7,6 +7,7 @@ use flate2::write::GzEncoder;
|
||||
|
||||
#[derive(Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Hash)]
|
||||
pub struct Location {
|
||||
pub file_label: Label,
|
||||
pub start_line: usize,
|
||||
pub start_column: usize,
|
||||
pub end_line: usize,
|
||||
@@ -136,10 +137,16 @@ impl fmt::Display for Entry {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
|
||||
// Identifiers of the form #0, #1...
|
||||
pub struct Label(u32);
|
||||
|
||||
impl fmt::Debug for Label {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "Label({:#x})", self.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Label {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "#{:x}", self.0)
|
||||
@@ -170,6 +177,30 @@ impl fmt::Display for Arg {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<String> for Arg {
|
||||
fn from(value: String) -> Self {
|
||||
Arg::String(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&str> for Arg {
|
||||
fn from(value: &str) -> Self {
|
||||
Arg::String(value.into())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Label> for Arg {
|
||||
fn from(value: Label) -> Self {
|
||||
Arg::Label(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<usize> for Arg {
|
||||
fn from(value: usize) -> Self {
|
||||
Arg::Int(value)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Program(Vec<Entry>);
|
||||
|
||||
impl fmt::Display for Program {
|
||||
|
||||
@@ -13,7 +13,7 @@ use common::{create_source_dir, expect_trap_file, SourceArchive};
|
||||
fn simple_extractor() {
|
||||
let language = simple::LanguageSpec {
|
||||
prefix: "ql",
|
||||
ts_language: tree_sitter_ql::language(),
|
||||
ts_language: tree_sitter_ql::LANGUAGE.into(),
|
||||
node_types: tree_sitter_ql::NODE_TYPES,
|
||||
file_globs: vec!["*.qll".into()],
|
||||
};
|
||||
|
||||
@@ -12,13 +12,13 @@ use common::{create_source_dir, expect_trap_file, SourceArchive};
|
||||
fn multiple_language_extractor() {
|
||||
let lang_ql = simple::LanguageSpec {
|
||||
prefix: "ql",
|
||||
ts_language: tree_sitter_ql::language(),
|
||||
ts_language: tree_sitter_ql::LANGUAGE.into(),
|
||||
node_types: tree_sitter_ql::NODE_TYPES,
|
||||
file_globs: vec!["*.qll".into()],
|
||||
};
|
||||
let lang_json = simple::LanguageSpec {
|
||||
prefix: "json",
|
||||
ts_language: tree_sitter_json::language(),
|
||||
ts_language: tree_sitter_json::LANGUAGE.into(),
|
||||
node_types: tree_sitter_json::NODE_TYPES,
|
||||
file_globs: vec!["*.json".into(), "*Jsonfile".into()],
|
||||
};
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.5
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
3
shared/tutorial/change-notes/released/1.0.6.md
Normal file
3
shared/tutorial/change-notes/released/1.0.6.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/tutorial/change-notes/released/1.0.7.md
Normal file
3
shared/tutorial/change-notes/released/1.0.7.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/tutorial/change-notes/released/1.0.8.md
Normal file
3
shared/tutorial/change-notes/released/1.0.8.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
lastReleaseVersion: 1.0.5
|
||||
lastReleaseVersion: 1.0.8
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: codeql/tutorial
|
||||
description: Library for the CodeQL detective tutorials, helping new users learn to
|
||||
write CodeQL queries.
|
||||
version: 1.0.6-dev
|
||||
version: 1.0.9-dev
|
||||
groups: shared
|
||||
library: true
|
||||
warnOnImplicitThis: true
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.5
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
3
shared/typeflow/change-notes/released/1.0.6.md
Normal file
3
shared/typeflow/change-notes/released/1.0.6.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/typeflow/change-notes/released/1.0.7.md
Normal file
3
shared/typeflow/change-notes/released/1.0.7.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/typeflow/change-notes/released/1.0.8.md
Normal file
3
shared/typeflow/change-notes/released/1.0.8.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
lastReleaseVersion: 1.0.5
|
||||
lastReleaseVersion: 1.0.8
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: codeql/typeflow
|
||||
version: 1.0.6-dev
|
||||
version: 1.0.9-dev
|
||||
groups: shared
|
||||
library: true
|
||||
dependencies:
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.5
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
3
shared/typetracking/change-notes/released/1.0.6.md
Normal file
3
shared/typetracking/change-notes/released/1.0.6.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/typetracking/change-notes/released/1.0.7.md
Normal file
3
shared/typetracking/change-notes/released/1.0.7.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/typetracking/change-notes/released/1.0.8.md
Normal file
3
shared/typetracking/change-notes/released/1.0.8.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
lastReleaseVersion: 1.0.5
|
||||
lastReleaseVersion: 1.0.8
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: codeql/typetracking
|
||||
version: 1.0.6-dev
|
||||
version: 1.0.9-dev
|
||||
groups: shared
|
||||
library: true
|
||||
dependencies:
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.5
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
3
shared/typos/change-notes/released/1.0.6.md
Normal file
3
shared/typos/change-notes/released/1.0.6.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/typos/change-notes/released/1.0.7.md
Normal file
3
shared/typos/change-notes/released/1.0.7.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/typos/change-notes/released/1.0.8.md
Normal file
3
shared/typos/change-notes/released/1.0.8.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
lastReleaseVersion: 1.0.5
|
||||
lastReleaseVersion: 1.0.8
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: codeql/typos
|
||||
version: 1.0.6-dev
|
||||
version: 1.0.9-dev
|
||||
groups: shared
|
||||
library: true
|
||||
warnOnImplicitThis: true
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.5
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
3
shared/util/change-notes/released/1.0.6.md
Normal file
3
shared/util/change-notes/released/1.0.6.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/util/change-notes/released/1.0.7.md
Normal file
3
shared/util/change-notes/released/1.0.7.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/util/change-notes/released/1.0.8.md
Normal file
3
shared/util/change-notes/released/1.0.8.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
lastReleaseVersion: 1.0.5
|
||||
lastReleaseVersion: 1.0.8
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: codeql/util
|
||||
version: 1.0.6-dev
|
||||
version: 1.0.9-dev
|
||||
groups: shared
|
||||
library: true
|
||||
dependencies: null
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.5
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
3
shared/xml/change-notes/released/1.0.6.md
Normal file
3
shared/xml/change-notes/released/1.0.6.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/xml/change-notes/released/1.0.7.md
Normal file
3
shared/xml/change-notes/released/1.0.7.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/xml/change-notes/released/1.0.8.md
Normal file
3
shared/xml/change-notes/released/1.0.8.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
lastReleaseVersion: 1.0.5
|
||||
lastReleaseVersion: 1.0.8
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: codeql/xml
|
||||
version: 1.0.6-dev
|
||||
version: 1.0.9-dev
|
||||
groups: shared
|
||||
library: true
|
||||
dependencies:
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.0.5
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
3
shared/yaml/change-notes/released/1.0.6.md
Normal file
3
shared/yaml/change-notes/released/1.0.6.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.6
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/yaml/change-notes/released/1.0.7.md
Normal file
3
shared/yaml/change-notes/released/1.0.7.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.7
|
||||
|
||||
No user-facing changes.
|
||||
3
shared/yaml/change-notes/released/1.0.8.md
Normal file
3
shared/yaml/change-notes/released/1.0.8.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.8
|
||||
|
||||
No user-facing changes.
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
lastReleaseVersion: 1.0.5
|
||||
lastReleaseVersion: 1.0.8
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: codeql/yaml
|
||||
version: 1.0.6-dev
|
||||
version: 1.0.9-dev
|
||||
groups: shared
|
||||
library: true
|
||||
warnOnImplicitThis: true
|
||||
|
||||
Reference in New Issue
Block a user