Skip to content

Commit 66eee73

Browse files
committed
Fixed issues in C# Language.qll
1 parent 9decd51 commit 66eee73

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

csharp/ql/lib/experimental/quantum/Language.qll

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,51 @@ private class UnknownDefaultLocation extends UnknownLocation {
1616
}
1717

1818
module CryptoInput implements InputSig<Language::Location> {
19-
class DataFlowNode = DataFlow::Node;
19+
class DataFlowNode = Language::DataFlow::Node;
2020

2121
class LocatableElement = Language::Element;
2222

2323
class UnknownLocation = UnknownDefaultLocation;
2424

25-
string locationToFileBaseNameAndLineNumberString(Location location) {
25+
string locationToFileBaseNameAndLineNumberString(Language::Location location) {
2626
result = location.getFile().getBaseName() + ":" + location.getStartLine()
2727
}
2828

29-
LocatableElement dfn_to_element(DataFlow::Node node) {
29+
LocatableElement dfn_to_element(Language::DataFlow::Node node) {
3030
result = node.asExpr() or
3131
result = node.asParameter()
3232
}
3333

3434
predicate artifactOutputFlowsToGenericInput(
35-
DataFlow::Node artifactOutput, DataFlow::Node otherInput
35+
Language::DataFlow::Node artifactOutput, Language::DataFlow::Node otherInput
3636
) {
3737
ArtifactFlow::flow(artifactOutput, otherInput)
3838
}
3939
}
4040

4141
// Instantiate the `CryptographyBase` module
4242
module Crypto = CryptographyBase<Language::Location, CryptoInput>;
43+
44+
module ArtifactFlowConfig implements Language::DataFlow::ConfigSig {
45+
predicate isSource(Language::DataFlow::Node source) {
46+
source = any(Crypto::ArtifactInstance artifact).getOutputNode()
47+
}
48+
49+
predicate isSink(Language::DataFlow::Node sink) {
50+
sink = any(Crypto::FlowAwareElement other).getInputNode()
51+
}
52+
53+
predicate isBarrierOut(Language::DataFlow::Node node) {
54+
node = any(Crypto::FlowAwareElement element).getInputNode()
55+
}
56+
57+
predicate isBarrierIn(Language::DataFlow::Node node) {
58+
node = any(Crypto::FlowAwareElement element).getOutputNode()
59+
}
60+
61+
predicate isAdditionalFlowStep(Language::DataFlow::Node node1, Language::DataFlow::Node node2) {
62+
none()
63+
}
64+
}
65+
66+
module ArtifactFlow = Language::DataFlow::Global<ArtifactFlowConfig>;

0 commit comments

Comments
 (0)