File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #77660 (Segmentation fault on break 2147483648)
3
+ --SKIPIF--
4
+ <?php if (PHP_INT_SIZE != 8 ) die ("skip this test is for 64bit platform only " ); ?>
5
+ --FILE--
6
+ <?php
7
+ for (;;) break 2147483648 ;
8
+ ?>
9
+ --EXPECTF--
10
+ Fatal error: Cannot 'break' 2147483648 levels in %sbug77660.php on line %d
Original file line number Diff line number Diff line change @@ -4528,7 +4528,7 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */
4528
4528
zend_ast * depth_ast = ast -> child [0 ];
4529
4529
4530
4530
zend_op * opline ;
4531
- int depth ;
4531
+ zend_long depth ;
4532
4532
4533
4533
ZEND_ASSERT (ast -> kind == ZEND_AST_BREAK || ast -> kind == ZEND_AST_CONTINUE );
4534
4534
@@ -4555,7 +4555,7 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */
4555
4555
ast -> kind == ZEND_AST_BREAK ? "break" : "continue" );
4556
4556
} else {
4557
4557
if (!zend_handle_loops_and_finally_ex (depth , NULL )) {
4558
- zend_error_noreturn (E_COMPILE_ERROR , "Cannot '%s' %d level%s" ,
4558
+ zend_error_noreturn (E_COMPILE_ERROR , "Cannot '%s' " ZEND_LONG_FMT " level%s" ,
4559
4559
ast -> kind == ZEND_AST_BREAK ? "break" : "continue" ,
4560
4560
depth , depth == 1 ? "" : "s" );
4561
4561
}
You can’t perform that action at this time.
0 commit comments