com php-src: Fix memory leak with return types upon failure TMP/VAR wasn't being freed in VERIFY_RETURN: Zend/zend_vm_def.h Zend/zend_vm_execute.h
| From: | Bob Weinand | Date: | Tue, 26 May 2015 23:18:06 +0000 |
| Subject: | com php-src: Fix memory leak with return types upon failure TMP/VAR wasn't being freed in VERIFY_RETURN: Zend/zend_vm_def.h Zend/zend_vm_execute.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86940@lists.php.net to get a copy of this message | ||
Commit: f7f7d6e385e91f70ee640018fd155dbd035a2e53
Author: Bob Weinand <bobwei9@hotmail.com> Wed, 27 May 2015 01:18:06 +0200
Parents: 5bec1490f90e1061d4b3416c8e34a5369c616475
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f7f7d6e385e91f70ee640018fd155dbd035a2e53
Log:
Fix memory leak with return types upon failure
TMP/VAR wasn't being freed in VERIFY_RETURN
Changed paths:
M Zend/zend_vm_def.h
M Zend/zend_vm_execute.h
Diff:
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index efbb081..55b72e9 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -3909,6 +3909,9 @@ ZEND_VM_HANDLER(124, ZEND_VERIFY_RETURN_TYPE, CONST|TMP|VAR|UNUSED|CV, UNUSED)
}
}
zend_verify_return_type(EX(func), retval_ptr);
+ if (EG(exception)) {
+ FREE_OP1();
+ }
#endif
}
CHECK_EXCEPTION();
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index cd95564..1119dca 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -7815,6 +7815,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL
ZEND_VERIFY_RETURN_TYPE_SPEC_CONST_
}
}
zend_verify_return_type(EX(func), retval_ptr);
+ if (EG(exception)) {
+
+ }
#endif
}
CHECK_EXCEPTION();
@@ -13437,6 +13440,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL
ZEND_VERIFY_RETURN_TYPE_SPEC_TMP_UN
}
}
zend_verify_return_type(EX(func), retval_ptr);
+ if (EG(exception)) {
+ zval_ptr_dtor_nogc(free_op1);
+ }
#endif
}
CHECK_EXCEPTION();
@@ -19195,6 +19201,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL
ZEND_VERIFY_RETURN_TYPE_SPEC_VAR_UN
}
}
zend_verify_return_type(EX(func), retval_ptr);
+ if (EG(exception)) {
+ zval_ptr_dtor_nogc(free_op1);
+ }
#endif
}
CHECK_EXCEPTION();
@@ -25140,6 +25149,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL
ZEND_VERIFY_RETURN_TYPE_SPEC_UNUSED
}
}
zend_verify_return_type(EX(func), retval_ptr);
+ if (EG(exception)) {
+
+ }
#endif
}
CHECK_EXCEPTION();
@@ -34786,6 +34798,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL
ZEND_VERIFY_RETURN_TYPE_SPEC_CV_UNU
}
}
zend_verify_return_type(EX(func), retval_ptr);
+ if (EG(exception)) {
+
+ }
#endif
}
CHECK_EXCEPTION();