Skip to content

Wrong offset key is reported in E_WARNING message with function JIT #12672

Closed
@pfustc

Description

@pfustc

Description

Hi @dstogov, below bug is found with CALL VM, function JIT and release build on my Mac (M1, AArch64). So far, I haven't reproduced it on Linux AArch64.

The following code:

<?php
function test() {
  $a[6] = 0;
  echo $a[5];
}
test();
?>

with php.ini:

opcache.enable_cli=1
opcache.jit=function
opcache.jit_buffer_size=16M
opcache.jit_hot_func=1
opcache.jit_hot_loop=1
opcache.jit_hot_return=1
opcache.jit_hot_side_exit=1
zend.assertions=1

Resulted in this output:

Warning: Undefined array key 6097925520 in /Users/penli01/work/www/index.php on line 4

But I expected this output instead:

Warning: Undefined array key 5 in /Users/penli01/work/www/index.php on line 4

Wrong offset key is reported in the warning message when using function JIT. Tracing JIT is OK based on my test.

PHP Version

master @ 2ca142e

Operating System

MacOS 14.1.1

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions