Skip to content

Commit f467260

Browse files
author
Robert Marsh
committed
C++: respond to PR comments.
1 parent 3266a89 commit f467260

File tree

8 files changed

+10
-11
lines changed

8 files changed

+10
-11
lines changed

cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/Instruction.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@ class SizedBufferMayWriteSideEffectInstruction extends WriteSideEffectInstructio
13421342

13431343
/**
13441344
* An instruction representing the initial value of newly allocated memory, e.g. the result of a
1345-
* call to `malloc`
1345+
* call to `malloc`.
13461346
*/
13471347
class InitializeDynamicAllocationInstruction extends SideEffectInstruction {
13481348
InitializeDynamicAllocationInstruction() {

cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/internal/AliasConfiguration.qll

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class DynamicAllocation extends Allocation, TDynamicAllocation {
105105
DynamicAllocation() { this = TDynamicAllocation(call) }
106106

107107
final override string toString() {
108-
result = call.toString() + " at " + call.getLocation() // TODO: make this both short and unique
108+
result = call.toString() + " at " + call.getLocation() // This isn't performant, but it's only used in test/dump code right not
109109
}
110110

111111
final override CallInstruction getABaseInstruction() { result = call }
@@ -116,9 +116,7 @@ class DynamicAllocation extends Allocation, TDynamicAllocation {
116116

117117
final override string getUniqueId() { result = call.getUniqueId() }
118118

119-
final override IRType getIRType() {
120-
result instanceof IRUnknownType // TODO: look at casts and sizes?
121-
}
119+
final override IRType getIRType() { result instanceof IRUnknownType }
122120

123121
final override predicate isReadOnly() { none() }
124122

cpp/ql/src/semmle/code/cpp/ir/implementation/raw/Instruction.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@ class SizedBufferMayWriteSideEffectInstruction extends WriteSideEffectInstructio
13421342

13431343
/**
13441344
* An instruction representing the initial value of newly allocated memory, e.g. the result of a
1345-
* call to `malloc`
1345+
* call to `malloc`.
13461346
*/
13471347
class InitializeDynamicAllocationInstruction extends SideEffectInstruction {
13481348
InitializeDynamicAllocationInstruction() {

cpp/ql/src/semmle/code/cpp/ir/implementation/raw/internal/TranslatedCall.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ class TranslatedSideEffects extends TranslatedElement, TTranslatedSideEffects {
345345
expr.getTarget() instanceof AllocationFunction and
346346
opcode instanceof Opcode::InitializeDynamicAllocation and
347347
tag = OnlyInstructionTag() and
348-
type = getUnknownType() // TODO: precise type
348+
type = getUnknownType()
349349
}
350350

351351
override Instruction getFirstInstruction() {
@@ -357,6 +357,7 @@ class TranslatedSideEffects extends TranslatedElement, TTranslatedSideEffects {
357357
override Instruction getInstructionSuccessor(InstructionTag tag, EdgeKind kind) {
358358
tag = OnlyInstructionTag() and
359359
kind = gotoEdge() and
360+
expr.getTarget() instanceof AllocationFunction and
360361
if exists(getChild(0))
361362
then result = getChild(0).getFirstInstruction()
362363
else result = getParent().getChildSuccessor(this)

cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/Instruction.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@ class SizedBufferMayWriteSideEffectInstruction extends WriteSideEffectInstructio
13421342

13431343
/**
13441344
* An instruction representing the initial value of newly allocated memory, e.g. the result of a
1345-
* call to `malloc`
1345+
* call to `malloc`.
13461346
*/
13471347
class InitializeDynamicAllocationInstruction extends SideEffectInstruction {
13481348
InitializeDynamicAllocationInstruction() {

cpp/ql/src/semmle/code/cpp/security/TaintTracking.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
* Support for tracking tainted data through the program.
33
*/
44

5-
import TaintTrackingImpl
5+
import semmle.code.cpp.ir.dataflow.DefaultTaintTracking

csharp/ql/src/semmle/code/csharp/ir/implementation/raw/Instruction.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@ class SizedBufferMayWriteSideEffectInstruction extends WriteSideEffectInstructio
13421342

13431343
/**
13441344
* An instruction representing the initial value of newly allocated memory, e.g. the result of a
1345-
* call to `malloc`
1345+
* call to `malloc`.
13461346
*/
13471347
class InitializeDynamicAllocationInstruction extends SideEffectInstruction {
13481348
InitializeDynamicAllocationInstruction() {

csharp/ql/src/semmle/code/csharp/ir/implementation/unaliased_ssa/Instruction.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@ class SizedBufferMayWriteSideEffectInstruction extends WriteSideEffectInstructio
13421342

13431343
/**
13441344
* An instruction representing the initial value of newly allocated memory, e.g. the result of a
1345-
* call to `malloc`
1345+
* call to `malloc`.
13461346
*/
13471347
class InitializeDynamicAllocationInstruction extends SideEffectInstruction {
13481348
InitializeDynamicAllocationInstruction() {

0 commit comments

Comments
 (0)