You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tracing JIT: keep the SEND_VAL type guard after assigning to a reference #24436
With opcache.jit=tracing, the value of an assignment expression $x = $y + 2 passed to a function is an int holding the raw bits of the double, when $x is a reference to a typed float property and the function was first run with a reference to an untyped property.
Expected float(5): the int is coerced to float when stored into the typed property, so the expression has the value 5.0. The interpreter and opcache.jit=function print float(5). 4617315517961601024 is 0x4014000000000000, the bit pattern of 5.0.
Found at c65321c (8.7.0-dev) and it still reproduces at 5ccc56b (latest upstream when checked). A debug build with ASan and UBSan (run with opcache.protect_memory=1) and a release build both exit 0 with the wrong output above, no assertion or sanitizer report.
Looks like the typed-reference branch of zend_jit_assign_to_variable in ext/opcache/jit/zend_jit_ir.c: the helper stores the coerced double in the result slot, but the trace types the result as long (from the earlier untyped run and from $y + 2), so the double bits are read as an int. Possibly related open PR, not tested here: #18392.
I can send a patch if that helps.
Found with an LLM-based testing tool; I used Claude to reduce it and look for the cause.
changed the title [-]Tracing JIT: value of `$x = $y + 2` is int with raw double bits when $x is a reference to a typed float property[/-][+]Tracing JIT: keep the SEND_VAL type guard after assigning to a reference[/+]on Oct 25, 2026
Activity
ndossche commentedon Oct 23, 2026
Feel free to do so and tag me ! 🙂
[-]Tracing JIT: value of `$x = $y + 2` is int with raw double bits when $x is a reference to a typed float property[/-][+]Tracing JIT: keep the SEND_VAL type guard after assigning to a reference[/+]Tracing JIT: keep the SEND_VAL type guard after assigning to a reference