@@ -341,16 +341,32 @@ class TranslatedSideEffects extends TranslatedElement, TTranslatedSideEffects {
341341 )
342342 }
343343
344- override predicate hasInstruction ( Opcode opcode , InstructionTag tag , CppType type ) { none ( ) }
345-
346- override Instruction getFirstInstruction ( ) { result = getChild ( 0 ) .getFirstInstruction ( ) }
344+ override predicate hasInstruction ( Opcode opcode , InstructionTag tag , CppType type ) {
345+ expr .getTarget ( ) instanceof AllocationFunction and
346+ opcode instanceof Opcode:: InitializeDynamicAllocation and
347+ tag = OnlyInstructionTag ( ) and
348+ type = getUnknownType ( )
349+ }
347350
348- override Instruction getInstructionSuccessor ( InstructionTag tag , EdgeKind kind ) { none ( ) }
351+ override Instruction getFirstInstruction ( ) {
352+ if expr .getTarget ( ) instanceof AllocationFunction
353+ then result = getInstruction ( OnlyInstructionTag ( ) )
354+ else result = getChild ( 0 ) .getFirstInstruction ( )
355+ }
349356
350- override Instruction getInstructionOperand ( InstructionTag tag , OperandTag operandTag ) { none ( ) }
357+ override Instruction getInstructionSuccessor ( InstructionTag tag , EdgeKind kind ) {
358+ tag = OnlyInstructionTag ( ) and
359+ kind = gotoEdge ( ) and
360+ expr .getTarget ( ) instanceof AllocationFunction and
361+ if exists ( getChild ( 0 ) )
362+ then result = getChild ( 0 ) .getFirstInstruction ( )
363+ else result = getParent ( ) .getChildSuccessor ( this )
364+ }
351365
352- override CppType getInstructionOperandType ( InstructionTag tag , TypedOperandTag operandTag ) {
353- none ( )
366+ override Instruction getInstructionOperand ( InstructionTag tag , OperandTag operandTag ) {
367+ tag = OnlyInstructionTag ( ) and
368+ operandTag = addressOperand ( ) and
369+ result = getPrimaryInstructionForSideEffect ( OnlyInstructionTag ( ) )
354370 }
355371
356372 override Instruction getPrimaryInstructionForSideEffect ( InstructionTag tag ) {
0 commit comments