Skip to content

zend_ssa_range_widening fails to converge on some input #19679

@arnaud-lb

Description

@arnaud-lb

Description

The following code:

<?php
function test() {
    $a = PHP_INT_MIN+1;
    $b = 0;
    while ($b++ < 3) {
        $a = (int) ($a-- - $b - 1);
    }
    return $a;
}
var_dump(test());
?>

Causes zend_ssa_range_widening() to not converge (the process hangs).

The range of some variables is subsequently initialized to [-9223372036854775807..-9223372036854775807] and [-9223372036854775808..9223372036854775807] during warmup. The upper bound then decreases indefinitely during the widening phase.

Found while creating more test cases for #19669.

PHP Version

master

Operating System

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions