File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 26
26
#include "Optimizer/scdf.h"
27
27
#include "Optimizer/zend_dump.h"
28
28
#include "ext/standard/php_string.h"
29
+ #include "zend_exceptions.h"
29
30
30
31
/* This implements sparse conditional constant propagation (SCCP) based on the SCDF framework. The
31
32
* used value lattice is defined as follows:
@@ -1040,12 +1041,20 @@ static inline int ct_eval_func_call(
1040
1041
for (i = 0 ; i < num_args ; i ++ ) {
1041
1042
ZVAL_COPY (EX_VAR_NUM (i ), args [i ]);
1042
1043
}
1044
+ ZVAL_NULL (result );
1043
1045
func -> internal_function .handler (execute_data , result );
1044
1046
for (i = 0 ; i < num_args ; i ++ ) {
1045
1047
zval_ptr_dtor_nogc (EX_VAR_NUM (i ));
1046
1048
}
1047
1049
efree (execute_data );
1048
1050
EG (current_execute_data ) = prev_execute_data ;
1051
+
1052
+ if (EG (exception )) {
1053
+ zval_ptr_dtor (result );
1054
+ zend_clear_exception ();
1055
+ return FAILURE ;
1056
+ }
1057
+
1049
1058
return SUCCESS ;
1050
1059
}
1051
1060
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Exception thrown during SCCP evaluation
3
+ --FILE--
4
+ <?php
5
+ var_dump (version_compare ('1.2 ' , '2.1 ' , '?? ' ));
6
+ ?>
7
+ --EXPECTF--
8
+ Fatal error: Uncaught ValueError: version_compare(): Argument #3 ($operator) must be a valid comparison operator in %s:%d
9
+ Stack trace:
10
+ #0 %s(%d): version_compare('1.2', '2.1', '??')
11
+ #1 {main}
12
+ thrown in %s on line %d
You can’t perform that action at this time.
0 commit comments