Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT Compiler encountered an internal limitation #500

Closed
calvinbaart opened this issue Aug 24, 2019 · 1 comment
Closed

JIT Compiler encountered an internal limitation #500

calvinbaart opened this issue Aug 24, 2019 · 1 comment
Assignees
Labels
Projects

Comments

@calvinbaart
Copy link
Contributor

@calvinbaart calvinbaart commented Aug 24, 2019

No idea why but this specific sample (removing the if-statement or return in parse causes the crash to not happen anymore) crashes:

trait BaseTrait
{
    public static function parse($time = null, $tz = null)
    {
        $function = static::$parseFunction;

        if (is_string($function) && method_exists(static::class, $function)) {
            $function = [static::class, $function];
        }

        return $function(...func_get_args());
    }

    public static function testFunc($time = null, $tz = null)
    {
        return "Hello World!";
    }
}

trait TestTrait
{
    use BaseTrait;
}

class TestClass
{
    private static $parseFunction = "testFunc";

    use TestTrait;
}

echo TestClass::parse() . "\r\n";

PeachPie output:

Unhandled Exception: System.InvalidProgramException: JIT Compiler encountered an internal limitation.
   at TestTrait`1.parse(Context <ctx>, PhpTypeInfo <static>, PhpValue time, PhpValue tz)
   at TestClass.parse(Context <ctx>, PhpTypeInfo <static>, PhpValue time, PhpValue tz)
   at <Root>.main_php.<Main>(Context <ctx>, PhpArray <locals>, Object this, RuntimeTypeHandle <self>) in /mnt/c/Development/laravel-peachpie-sample/Laravel.Tests/main.php:line 68
   at <Script>.Main(String[] args)

PHP output:

Hello World!
@jakubmisek

This comment has been minimized.

Copy link
Member

@jakubmisek jakubmisek commented Aug 24, 2019

thanks @calvinbaart , this one must be really hard to find

@jakubmisek jakubmisek self-assigned this Aug 24, 2019
@jakubmisek jakubmisek added the 🐞 bug label Aug 24, 2019
@jakubmisek jakubmisek added this to To do in Laravel via automation Aug 24, 2019
@jakubmisek jakubmisek moved this from To do to Done in Laravel Sep 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Laravel
  
Done
2 participants
You can’t perform that action at this time.