Skip to content

Commit 3ea3519

Browse files
author
Robert Marsh
committed
C++/C#: sync changes
1 parent 7f69cdf commit 3ea3519

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

csharp/ql/src/semmle/code/csharp/ir/implementation/Opcode.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ private newtype TOpcode =
8282
TSizedBufferReadSideEffect() or
8383
TSizedBufferMustWriteSideEffect() or
8484
TSizedBufferMayWriteSideEffect() or
85+
TInitializeDynamicAllocation() or
8586
TChi() or
8687
TInlineAsm() or
8788
TUnreached() or
@@ -695,6 +696,10 @@ module Opcode {
695696
final override string toString() { result = "SizedBufferMayWriteSideEffect" }
696697
}
697698

699+
class InitializeDynamicAllocation extends SideEffectOpcode, EntireAllocationWriteOpcode, TInitializeDynamicAllocation {
700+
final override string toString() { result = "InitializeDynamicAllocation" }
701+
}
702+
698703
class Chi extends Opcode, TChi {
699704
final override string toString() { result = "Chi" }
700705

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,6 +1340,20 @@ class SizedBufferMayWriteSideEffectInstruction extends WriteSideEffectInstructio
13401340
Instruction getSizeDef() { result = getAnOperand().(BufferSizeOperand).getDef() }
13411341
}
13421342

1343+
/**
1344+
*
1345+
*/
1346+
class InitializeDynamicAllocationInstruction extends SideEffectInstruction {
1347+
InitializeDynamicAllocationInstruction() {
1348+
getOpcode() instanceof Opcode::InitializeDynamicAllocation
1349+
}
1350+
1351+
final AddressOperand getAllocationAddressOperand() { result = getAnOperand() }
1352+
1353+
final Instruction getAllocationAddress() { result = getAllocationAddressOperand().getDef() }
1354+
1355+
}
1356+
13431357
/**
13441358
* An instruction representing a GNU or MSVC inline assembly statement.
13451359
*/

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,6 +1340,20 @@ class SizedBufferMayWriteSideEffectInstruction extends WriteSideEffectInstructio
13401340
Instruction getSizeDef() { result = getAnOperand().(BufferSizeOperand).getDef() }
13411341
}
13421342

1343+
/**
1344+
*
1345+
*/
1346+
class InitializeDynamicAllocationInstruction extends SideEffectInstruction {
1347+
InitializeDynamicAllocationInstruction() {
1348+
getOpcode() instanceof Opcode::InitializeDynamicAllocation
1349+
}
1350+
1351+
final AddressOperand getAllocationAddressOperand() { result = getAnOperand() }
1352+
1353+
final Instruction getAllocationAddress() { result = getAllocationAddressOperand().getDef() }
1354+
1355+
}
1356+
13431357
/**
13441358
* An instruction representing a GNU or MSVC inline assembly statement.
13451359
*/

0 commit comments

Comments
 (0)