Skip to content

Commit 950d70f

Browse files
committed
C++: Replace 'InitializeGroup' with 'UninitializedGroup'.
1 parent 4893785 commit 950d70f

File tree

9 files changed

+100
-92
lines changed

9 files changed

+100
-92
lines changed

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternalsCommon.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ predicate ignoreInstruction(Instruction instr) {
4141
instr instanceof AliasedUseInstruction or
4242
instr instanceof InitializeNonLocalInstruction or
4343
instr instanceof ReturnIndirectionInstruction or
44-
instr instanceof InitializeGroupInstruction
44+
instr instanceof UninitializedGroupInstruction
4545
)
4646
}
4747

cpp/ql/lib/semmle/code/cpp/ir/implementation/MemoryAccessKind.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class ChiPartialMemoryAccess extends MemoryAccessKind, TChiPartialMemoryAccess {
102102
}
103103

104104
/**
105-
* The result of an `InitializeGroup` instruction, which initializes a set of
105+
* The result of an `UninitializedGroup` instruction, which initializes a set of
106106
* allocations that are each assigned the same virtual variable.
107107
*/
108108
class GroupedMemoryAccess extends MemoryAccessKind, TGroupedMemoryAccess {

cpp/ql/lib/semmle/code/cpp/ir/implementation/Opcode.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private newtype TOpcode =
8989
TSizedBufferMayWriteSideEffect() or
9090
TInitializeDynamicAllocation() or
9191
TChi() or
92-
TInitializeGroup() or
92+
TUninitializedGroup() or
9393
TInlineAsm() or
9494
TUnreached() or
9595
TNewObj()
@@ -1239,12 +1239,12 @@ module Opcode {
12391239
}
12401240

12411241
/**
1242-
* The `Opcode` for a `InitializeGroup`.
1242+
* The `Opcode` for a `UninitializedGroup`.
12431243
*
1244-
* See the `InitializeGroupInstruction` documentation for more details.
1244+
* See the `UninitializedGroupInstruction` documentation for more details.
12451245
*/
1246-
class InitializeGroup extends Opcode, TInitializeGroup {
1247-
final override string toString() { result = "InitializeGroup" }
1246+
class UninitializedGroup extends Opcode, TUninitializedGroup {
1247+
final override string toString() { result = "UninitializedGroup" }
12481248

12491249
override GroupedMemoryAccess getWriteMemoryAccess() { any() }
12501250
}

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2162,19 +2162,21 @@ class ChiInstruction extends Instruction {
21622162
*
21632163
* Since both the address of `a` and `b` reach `p` at `*p = 5` the IR alias
21642164
* analysis will create a region that contains both `a` and `b`. The region
2165-
* containing both `a` and `b` are initialized by an `InitializeGroup`
2165+
* containing both `a` and `b` are initialized by an `UninitializedGroup`
21662166
* instruction in the entry block of the enclosing function.
21672167
*/
2168-
class InitializeGroupInstruction extends Instruction {
2169-
InitializeGroupInstruction() { this.getOpcode() instanceof Opcode::InitializeGroup }
2168+
class UninitializedGroupInstruction extends Instruction {
2169+
UninitializedGroupInstruction() { this.getOpcode() instanceof Opcode::UninitializedGroup }
21702170

21712171
/**
21722172
* Gets an `IRVariable` whose memory is initialized by this instruction, if any.
21732173
* Note: Allocations that are not represented as `IRVariable`s (such as
21742174
* dynamic allocations) are not returned by this predicate even if this
21752175
* instruction initializes such memory.
21762176
*/
2177-
final IRVariable getAnIRVariable() { result = Construction::getAnInitializeGroupVariable(this) }
2177+
final IRVariable getAnIRVariable() {
2178+
result = Construction::getAnUninitializedGroupVariable(this)
2179+
}
21782180

21792181
final override string getImmediateString() {
21802182
result = strictconcat(this.getAnIRVariable().toString(), ",")

cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/AliasedSSA.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class VariableGroup extends AllocationSet::EquivalenceClass {
179179
* getInitializationOrder() = 2
180180
* ```
181181
* then this set will be initialized as the second (third) set in the
182-
* enclosing function. In order words, the third `InitializeGroup`
182+
* enclosing function. In order words, the third `UninitializedGroup`
183183
* instruction in the entry block of the enclosing function will initialize
184184
* this set of allocations.
185185
*/

0 commit comments

Comments
 (0)