Paullo612 / mlfx

OpenJFX's FXML language AOT compler
Apache License 2.0
12 stars 0 forks source link

Incorrect handling of primitives that take two variable slots #14

Closed Paullo612 closed 1 year ago

Paullo612 commented 1 year ago

Change FooFactory's return type to long and consider following FXML:

<?import io.github.paullo612.mlfx.compiler.test.Crankshaft?>
<?import io.github.paullo612.mlfx.compiler.test.Crankpin?>
<?import io.github.paullo612.mlfx.compiler.test.FooFactory?>

<Crankshaft xmlns="http://javafx.com/javafx/19.0.0" xmlns:fx="http://javafx.com/fxml/1">
    <fx:define>
        <!-- Save primitive that takes two slots -->
        <FooFactory fx:id="pinId" fx:factory="foo" />
        <!-- Save reference that takes one slot after -->
        <Crankpin fx:id="firstPin" id="1" />
    </fx:define>
    <crankpins>
        <!-- And let it all crash with VerifyError -->
        <fx:reference source="firstPin"/>
        <Crankpin id="$pinId"/>
    </crankpins>
</Crankshaft>

This will crash with java.lang.VerifyError on load attempt.