[php-src] Issue #9011: Assertion failure with tracing JIT

From: Date: Thu, 14 Jul 2022 13:30:08 +0000
Subject: [php-src] Issue #9011: Assertion failure with tracing JIT
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-241930@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/9011
Author: cmb69

### Description

The following code (script provided by @zeriyoshi):

```php
<?php

$foo = [];
$foo[] = new \Exception(); /* Native interface implemented Native instance */
$foo[] = new class () implements \Stringable /* Native interface implemented User instance */
{
    public function __toString(): string
    {
        return "bar";
    }
};

foreach ($foo as $baz) {
    for ($i = 0; $i < 64; $i++) {
        $baz->__toString();
    }
}
```

Resulted in this output:
```
Assertion failed: ((execute_data)->opline) >= ((execute_data)->func)->op_array.opcodes
&& ((execute_data)->opline) < ((execute_data)->func)->op_array.opcodes +
((execute_data)->func)->op_array.last, file
C:\php-sdk\phpdev\vs16\x64\php-src-8.0\ext\opcache\jit/zend_jit_trace.c, line 7679
```
https://github.com/php/php-src/blob/789a37f14405e2d1a05a76c9fb4ed2d49d4580d5/ext/opcache/jit/zend_jit_trace.c#L7678-L7679

But I expected this output instead:
```
```


### PHP Version

>= PHP-8.0

### Operating System

Windows, maybe others as well


Thread (1 message)

  • cmb69
« previous php.bugs (#241930) next »