Skip to content

A closure called with a stdClass property as its by-reference argument emits invalid IR. #248

Closed

Description

@blacktrs

Summary

A closure called with a stdClass property as its by-reference argument emits invalid IR.

Repro

<?php
$inc = function (&$v) { $v = $v . "z"; };
$props = new stdClass;
$props->p = "q";
$inc($props->p);
echo $props->p, "\n";

Expected (php)

qz

Actual (manticore dd1034bd, Darwin arm64)

compile failed (rc=75):
/tmp/manticore_<pid>.ll:15390:56: error: '%r32' defined with type 'ptr' but expected 'i64'
 15390 |   %r33 = call i64 @manticore___closure_0(ptr %r32, i64 %r32)
       |                                                        ^
1 error generated.
assemble: clang -c failed (rc=256); IR at /tmp/manticore_<pid>.ll

Tracking

Known-bug repro: tests/aot/repro/crash/closure_byref_arg_stdclass_prop_invalid_ir.php — bash tests/aot/xfail.sh -k closure_byref_arg_stdclass_prop_invalid_ir reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcrash

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions