Skip to content

ensure consistent casing of names #10312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
private import SSAConstruction as SSA
import SSA::SsaConsistency
private import SSAConstruction as Ssa
import Ssa::SsaConsistency
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ deprecated module SSAConsistency = SsaConsistency;
* These predicates are all just aliases for predicates defined in the `Cached` module. This ensures
* that all of SSA construction will be evaluated in the same stage.
*/
module SSA {
module Ssa {
class MemoryLocation = Alias::MemoryLocation;

predicate hasPhiInstruction = Cached::hasPhiInstructionCached/2;
Expand All @@ -1144,3 +1144,6 @@ module SSA {

predicate hasUnreachedInstruction = Cached::hasUnreachedInstructionCached/1;
}

/** DEPRECATED: Alias for Ssa */
deprecated module SSA = Ssa;
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@ newtype TInstruction =
IRConstruction::Raw::hasInstruction(tag1, tag2)
} or
TUnaliasedSsaPhiInstruction(
TRawInstruction blockStartInstr, UnaliasedSsa::SSA::MemoryLocation memoryLocation
TRawInstruction blockStartInstr, UnaliasedSsa::Ssa::MemoryLocation memoryLocation
) {
UnaliasedSsa::SSA::hasPhiInstruction(blockStartInstr, memoryLocation)
UnaliasedSsa::Ssa::hasPhiInstruction(blockStartInstr, memoryLocation)
} or
TUnaliasedSsaChiInstruction(TRawInstruction primaryInstruction) { none() } or
TUnaliasedSsaUnreachedInstruction(IRFunctionBase irFunc) {
UnaliasedSsa::SSA::hasUnreachedInstruction(irFunc)
UnaliasedSsa::Ssa::hasUnreachedInstruction(irFunc)
} or
TAliasedSsaPhiInstruction(
TRawInstruction blockStartInstr, AliasedSsa::SSA::MemoryLocation memoryLocation
TRawInstruction blockStartInstr, AliasedSsa::Ssa::MemoryLocation memoryLocation
) {
AliasedSsa::SSA::hasPhiInstruction(blockStartInstr, memoryLocation)
AliasedSsa::Ssa::hasPhiInstruction(blockStartInstr, memoryLocation)
} or
TAliasedSsaChiInstruction(TRawInstruction primaryInstruction) {
AliasedSsa::SSA::hasChiInstruction(primaryInstruction)
AliasedSsa::Ssa::hasChiInstruction(primaryInstruction)
} or
TAliasedSsaUnreachedInstruction(IRFunctionBase irFunc) {
AliasedSsa::SSA::hasUnreachedInstruction(irFunc)
AliasedSsa::Ssa::hasUnreachedInstruction(irFunc)
}

/**
Expand All @@ -50,7 +50,7 @@ module UnaliasedSsaInstructions {
class TPhiInstruction = TUnaliasedSsaPhiInstruction;

TPhiInstruction phiInstruction(
TRawInstruction blockStartInstr, UnaliasedSsa::SSA::MemoryLocation memoryLocation
TRawInstruction blockStartInstr, UnaliasedSsa::Ssa::MemoryLocation memoryLocation
) {
result = TUnaliasedSsaPhiInstruction(blockStartInstr, memoryLocation)
}
Expand Down Expand Up @@ -83,7 +83,7 @@ module AliasedSsaInstructions {
class TPhiInstruction = TAliasedSsaPhiInstruction or TUnaliasedSsaPhiInstruction;

TPhiInstruction phiInstruction(
TRawInstruction blockStartInstr, AliasedSsa::SSA::MemoryLocation memoryLocation
TRawInstruction blockStartInstr, AliasedSsa::Ssa::MemoryLocation memoryLocation
) {
result = TAliasedSsaPhiInstruction(blockStartInstr, memoryLocation)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
private import SSAConstruction as SSA
import SSA::SsaConsistency
private import SSAConstruction as Ssa
import Ssa::SsaConsistency
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ deprecated module SSAConsistency = SsaConsistency;
* These predicates are all just aliases for predicates defined in the `Cached` module. This ensures
* that all of SSA construction will be evaluated in the same stage.
*/
module SSA {
module Ssa {
class MemoryLocation = Alias::MemoryLocation;

predicate hasPhiInstruction = Cached::hasPhiInstructionCached/2;
Expand All @@ -1144,3 +1144,6 @@ module SSA {

predicate hasUnreachedInstruction = Cached::hasUnreachedInstructionCached/1;
}

/** DEPRECATED: Alias for Ssa */
deprecated module SSA = Ssa;
2 changes: 1 addition & 1 deletion csharp/ql/lib/semmle/code/cil/CallableReturns.qll
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private predicate alwaysNotNullVariableUpdate(VariableUpdate vu) {

/** Holds if expression `expr` always evaluates to non-null. */
private predicate alwaysNotNullExpr(Expr expr) {
expr instanceof Opcodes::Newobj
expr instanceof Opcodes::NewObj
or
expr instanceof Literal and not expr instanceof NullLiteral
or
Expand Down
10 changes: 8 additions & 2 deletions csharp/ql/lib/semmle/code/cil/Instructions.qll
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ module Opcodes {
}

/** A `newobj` instruction. */
class Newobj extends Call, @cil_newobj {
class NewObj extends Call, @cil_newobj {
override string getOpcodeName() { result = "newobj" }

override int getPushCount() { result = 1 }
Expand All @@ -788,6 +788,9 @@ module Opcodes {
}
}

/** DEPRECATED: Alias for NewObj */
deprecated class Newobj = NewObj;

/** An `initobj` instruction. */
class Initobj extends Instruction, @cil_initobj {
override string getOpcodeName() { result = "initobj" }
Expand Down Expand Up @@ -847,10 +850,13 @@ module Opcodes {
}

/** A `rethrow` instruction. */
class Rethrow extends Throw, @cil_rethrow {
class ReThrow extends Throw, @cil_rethrow {
override string getOpcodeName() { result = "rethrow" }
}

/** DEPRECATED: Alias for ReThrow */
deprecated class Rethrow = ReThrow;

/** A `ldlen` instruction. */
class Ldlen extends UnaryExpr, @cil_ldlen {
override string getOpcodeName() { result = "ldlen" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
private import IRFunctionBase
private import TInstruction

module SSA {
module Ssa {
class MemoryLocation = boolean;

predicate hasPhiInstruction(TRawInstruction blockStartInstr, MemoryLocation memoryLocation) {
Expand All @@ -17,3 +17,6 @@ module SSA {

predicate hasUnreachedInstruction(IRFunctionBase irFunc) { none() }
}

/** DEPRECATED: Alias for Ssa */
deprecated module SSA = Ssa;
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@ newtype TInstruction =
IRConstruction::Raw::hasInstruction(tag1, tag2)
} or
TUnaliasedSsaPhiInstruction(
TRawInstruction blockStartInstr, UnaliasedSsa::SSA::MemoryLocation memoryLocation
TRawInstruction blockStartInstr, UnaliasedSsa::Ssa::MemoryLocation memoryLocation
) {
UnaliasedSsa::SSA::hasPhiInstruction(blockStartInstr, memoryLocation)
UnaliasedSsa::Ssa::hasPhiInstruction(blockStartInstr, memoryLocation)
} or
TUnaliasedSsaChiInstruction(TRawInstruction primaryInstruction) { none() } or
TUnaliasedSsaUnreachedInstruction(IRFunctionBase irFunc) {
UnaliasedSsa::SSA::hasUnreachedInstruction(irFunc)
UnaliasedSsa::Ssa::hasUnreachedInstruction(irFunc)
} or
TAliasedSsaPhiInstruction(
TRawInstruction blockStartInstr, AliasedSsa::SSA::MemoryLocation memoryLocation
TRawInstruction blockStartInstr, AliasedSsa::Ssa::MemoryLocation memoryLocation
) {
AliasedSsa::SSA::hasPhiInstruction(blockStartInstr, memoryLocation)
AliasedSsa::Ssa::hasPhiInstruction(blockStartInstr, memoryLocation)
} or
TAliasedSsaChiInstruction(TRawInstruction primaryInstruction) {
AliasedSsa::SSA::hasChiInstruction(primaryInstruction)
AliasedSsa::Ssa::hasChiInstruction(primaryInstruction)
} or
TAliasedSsaUnreachedInstruction(IRFunctionBase irFunc) {
AliasedSsa::SSA::hasUnreachedInstruction(irFunc)
AliasedSsa::Ssa::hasUnreachedInstruction(irFunc)
}

/**
Expand All @@ -50,7 +50,7 @@ module UnaliasedSsaInstructions {
class TPhiInstruction = TUnaliasedSsaPhiInstruction;

TPhiInstruction phiInstruction(
TRawInstruction blockStartInstr, UnaliasedSsa::SSA::MemoryLocation memoryLocation
TRawInstruction blockStartInstr, UnaliasedSsa::Ssa::MemoryLocation memoryLocation
) {
result = TUnaliasedSsaPhiInstruction(blockStartInstr, memoryLocation)
}
Expand Down Expand Up @@ -83,7 +83,7 @@ module AliasedSsaInstructions {
class TPhiInstruction = TAliasedSsaPhiInstruction or TUnaliasedSsaPhiInstruction;

TPhiInstruction phiInstruction(
TRawInstruction blockStartInstr, AliasedSsa::SSA::MemoryLocation memoryLocation
TRawInstruction blockStartInstr, AliasedSsa::Ssa::MemoryLocation memoryLocation
) {
result = TAliasedSsaPhiInstruction(blockStartInstr, memoryLocation)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
private import SSAConstruction as SSA
import SSA::SsaConsistency
private import SSAConstruction as Ssa
import Ssa::SsaConsistency
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ deprecated module SSAConsistency = SsaConsistency;
* These predicates are all just aliases for predicates defined in the `Cached` module. This ensures
* that all of SSA construction will be evaluated in the same stage.
*/
module SSA {
module Ssa {
class MemoryLocation = Alias::MemoryLocation;

predicate hasPhiInstruction = Cached::hasPhiInstructionCached/2;
Expand All @@ -1144,3 +1144,6 @@ module SSA {

predicate hasUnreachedInstruction = Cached::hasUnreachedInstructionCached/1;
}

/** DEPRECATED: Alias for Ssa */
deprecated module SSA = Ssa;
9 changes: 6 additions & 3 deletions go/ql/lib/semmle/go/concepts/HTTP.qll
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import go

/** Provides classes for modeling HTTP-related APIs. */
module HTTP {
module Http {
/** Provides a class for modeling new HTTP response-writer APIs. */
module ResponseWriter {
/**
Expand Down Expand Up @@ -191,7 +191,7 @@ module HTTP {

/** Gets a content-type associated with this body. */
string getAContentType() {
exists(HTTP::HeaderWrite hw | hw = this.getResponseWriter().getAHeaderWrite() |
exists(Http::HeaderWrite hw | hw = this.getResponseWriter().getAHeaderWrite() |
hw.getHeaderName() = "content-type" and
result = hw.getHeaderValue()
)
Expand All @@ -201,7 +201,7 @@ module HTTP {

/** Gets a dataflow node for a content-type associated with this body. */
DataFlow::Node getAContentTypeNode() {
exists(HTTP::HeaderWrite hw | hw = this.getResponseWriter().getAHeaderWrite() |
exists(Http::HeaderWrite hw | hw = this.getResponseWriter().getAHeaderWrite() |
hw.getHeaderName() = "content-type" and
result = hw.getValue()
)
Expand Down Expand Up @@ -378,3 +378,6 @@ module HTTP {
predicate guardedBy(DataFlow::Node check) { self.guardedBy(check) }
}
}

/** DEPRECATED: Alias for Http */
deprecated module HTTP = Http;
24 changes: 12 additions & 12 deletions go/ql/lib/semmle/go/frameworks/Beego.qll
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ module Beego {
}
}

private class BeegoOutputInstance extends HTTP::ResponseWriter::Range {
private class BeegoOutputInstance extends Http::ResponseWriter::Range {
SsaWithFields v;

BeegoOutputInstance() {
Expand All @@ -131,7 +131,7 @@ module Beego {
}
}

private class BeegoHeaderWrite extends HTTP::HeaderWrite::Range, DataFlow::MethodCallNode {
private class BeegoHeaderWrite extends Http::HeaderWrite::Range, DataFlow::MethodCallNode {
string methodName;

BeegoHeaderWrite() {
Expand All @@ -142,7 +142,7 @@ module Beego {
override DataFlow::Node getName() { methodName = "Header" and result = this.getArgument(0) }

override string getHeaderName() {
result = HTTP::HeaderWrite::Range.super.getHeaderName()
result = Http::HeaderWrite::Range.super.getHeaderName()
or
methodName = "ContentType" and result = "content-type"
}
Expand All @@ -153,12 +153,12 @@ module Beego {
else result = this.getArgument(1)
}

override HTTP::ResponseWriter getResponseWriter() {
override Http::ResponseWriter getResponseWriter() {
result.(BeegoOutputInstance).getAHeaderObject() = this
}
}

private class BeegoResponseBody extends HTTP::ResponseBody::Range {
private class BeegoResponseBody extends Http::ResponseBody::Range {
DataFlow::MethodCallNode call;
string methodName;

Expand All @@ -170,7 +170,7 @@ module Beego {
methodName in ["Body", "JSON", "JSONP", "ServeFormatted", "XML", "YAML"]
}

override HTTP::ResponseWriter getResponseWriter() { result.getANode() = call.getReceiver() }
override Http::ResponseWriter getResponseWriter() { result.getANode() = call.getReceiver() }

override string getAContentType() {
// Super-method provides content-types for `Body`, which requires us to search
Expand All @@ -192,7 +192,7 @@ module Beego {
}
}

private class ControllerResponseBody extends HTTP::ResponseBody::Range {
private class ControllerResponseBody extends Http::ResponseBody::Range {
string name;

ControllerResponseBody() {
Expand All @@ -203,7 +203,7 @@ module Beego {
)
}

override HTTP::ResponseWriter getResponseWriter() { none() }
override Http::ResponseWriter getResponseWriter() { none() }

override string getAContentType() {
// Actually SetData can serve JSON, XML or YAML depending on the incoming
Expand All @@ -213,7 +213,7 @@ module Beego {
}
}

private class ContextResponseBody extends HTTP::ResponseBody::Range {
private class ContextResponseBody extends Http::ResponseBody::Range {
string name;

ContextResponseBody() {
Expand All @@ -224,7 +224,7 @@ module Beego {
)
}

override HTTP::ResponseWriter getResponseWriter() { none() }
override Http::ResponseWriter getResponseWriter() { none() }

// Neither method is likely to be used with well-typed data such as JSON output,
// because there are better methods to do this. Assume the Content-Type could
Expand Down Expand Up @@ -314,7 +314,7 @@ module Beego {
}
}

private class RedirectMethods extends HTTP::Redirect::Range, DataFlow::CallNode {
private class RedirectMethods extends Http::Redirect::Range, DataFlow::CallNode {
string package;
string className;

Expand All @@ -333,7 +333,7 @@ module Beego {
className = "Context" and result = this.getArgument(1)
}

override HTTP::ResponseWriter getResponseWriter() { none() }
override Http::ResponseWriter getResponseWriter() { none() }
}

private class UtilsTaintPropagators extends TaintTracking::FunctionModel {
Expand Down
Loading