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 @@ -4272,7 +4272,7 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */
4272
4272
zend_ast * depth_ast = ast -> child [0 ];
4273
4273
4274
4274
zend_op * opline ;
4275
- int depth ;
4275
+ zend_long depth ;
4276
4276
4277
4277
ZEND_ASSERT (ast -> kind == ZEND_AST_BREAK || ast -> kind == ZEND_AST_CONTINUE );
4278
4278
@@ -4299,7 +4299,7 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */
4299
4299
ast -> kind == ZEND_AST_BREAK ? "break" : "continue" );
4300
4300
} else {
4301
4301
if (!zend_handle_loops_and_finally_ex (depth , NULL )) {
4302
- zend_error_noreturn (E_COMPILE_ERROR , "Cannot '%s' %d level%s" ,
4302
+ zend_error_noreturn (E_COMPILE_ERROR , "Cannot '%s' " ZEND_LONG_FMT " level%s" ,
4303
4303
ast -> kind == ZEND_AST_BREAK ? "break" : "continue" ,
4304
4304
depth , depth == 1 ? "" : "s" );
4305
4305
}
You can’t perform that action at this time.
0 commit comments