@@ -2021,13 +2021,37 @@ TranslatedAllocatorCall getTranslatedAllocatorCall(NewOrNewArrayExpr newExpr) {
20212021 * The IR translation of a call to `operator delete` as part of a `delete` or `delete[]`
20222022 * expression.
20232023 */
2024- class TranslatedDeallocatorCall extends TTranslatedDeallocatorCall , TranslatedDirectCall {
2024+ class TranslatedDeallocatorCall extends TTranslatedDeallocatorCall , TranslatedCall {
20252025 override DeleteOrDeleteArrayExpr expr ;
20262026
20272027 TranslatedDeallocatorCall ( ) { this = TTranslatedDeallocatorCall ( expr ) }
20282028
20292029 final override string toString ( ) { result = "Deallocator call for " + expr .toString ( ) }
20302030
2031+ final override Instruction getFirstCallTargetInstruction ( ) {
2032+ result = this .getInstruction ( CallTargetTag ( ) )
2033+ }
2034+
2035+ final override Instruction getCallTargetResult ( ) { result = this .getInstruction ( CallTargetTag ( ) ) }
2036+
2037+ override predicate hasInstruction ( Opcode opcode , InstructionTag tag , CppType resultType ) {
2038+ TranslatedCall .super .hasInstruction ( opcode , tag , resultType )
2039+ or
2040+ tag = CallTargetTag ( ) and
2041+ resultType = getFunctionGLValueType ( ) and
2042+ if exists ( expr .getDeallocator ( ) )
2043+ then opcode instanceof Opcode:: FunctionAddress
2044+ else opcode instanceof Opcode:: VirtualDeleteFunctionAddress
2045+ }
2046+
2047+ override Instruction getInstructionSuccessor ( InstructionTag tag , EdgeKind kind ) {
2048+ result = TranslatedCall .super .getInstructionSuccessor ( tag , kind )
2049+ or
2050+ tag = CallTargetTag ( ) and
2051+ kind instanceof GotoEdge and
2052+ result = this .getFirstArgumentOrCallInstruction ( )
2053+ }
2054+
20312055 final override predicate producesExprResult ( ) { none ( ) }
20322056
20332057 override Function getInstructionFunction ( InstructionTag tag ) {
0 commit comments