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

Expressions that return two slots primitives are broken #35

Closed
Paullo612 opened this issue May 26, 2023 · 0 comments
Closed

Expressions that return two slots primitives are broken #35

Paullo612 opened this issue May 26, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Paullo612
Copy link
Owner

Steps to reproduce:

  1. Clone mlfx-samle project.
  2. Replace contents of src/main/resources/hellofxml/hello.fxml with following FXML code:
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.VBox?>


<AnchorPane fx:id="pane" prefHeight="400.0" prefWidth="600.0" stylesheets="@style.css" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="hellofx.HelloController">
   <children>
      <VBox layoutX="223.0" layoutY="166.0" prefHeight="400.0" prefWidth="600.0" styleClass="box" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
         <children>
            <Button prefWidth="${pane.width}" fx:id="button" mnemonicParsing="false" text="%button.text" />
            <Label fx:id="label" text="%label.text" visible="false" />
         </children>
      </VBox>
   </children>
</AnchorPane>
  1. Observe java.lang.VerifyError:
Caused by: java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    hellofxml/$Hello$CompiledFXMLLoader$Expression0.update(I)V @100: swap
  Reason:
    Type double_2nd (current frame, stack[1]) is not assignable to category1 type
  Current Frame:
    bci: @100
    flags: { }
    locals: { 'hellofxml/$Hello$CompiledFXMLLoader$Expression0', integer, integer }
    stack: { double, double_2nd, 'hellofxml/$Hello$CompiledFXMLLoader$Expression0' }
  Bytecode:
    0000000: 2ab4 0016 b900 1c01 0003 3d1b aa00 0000
    0000010: 0000 0049 0000 0000 0000 0001 0000 0018
    0000020: 0000 0046 2ab4 0016 2ab4 0022 03b9 0026
    0000030: 0300 2a2a b400 22b6 002c b500 2e2a b400
    0000040: 162a b400 222a b400 22b6 0032 03b9 0036
    0000050: 0400 a700 0dbb 0038 5912 3ab7 003e bf2a
    0000060: b400 2e2a 5fb6 0044 2ab4 0016 b900 4701
    0000070: 00a7 000f 4d2a b400 16b9 0047 0100 2cbf
    0000080: b1                                     
  Exception Handler Table:
    bci [9, 104] => handler: 116
  Stackmap Table:
    append_frame(@36,Integer)
    same_frame(@82)
    same_frame(@85)
    same_frame(@95)
    full_frame(@116,{Object[#2],Integer},{Object[#73]})
    append_frame(@128,Integer)
	at hellofxml/hellofxml.$Hello$CompiledFXMLLoader.doLoad(Unknown Source)
	at hellofxml/hellofxml.$Hello$CompiledFXMLLoader.doLoad(Unknown Source)
	at io.github.paullo612.mlfx.api.core@0.6.1-SNAPSHOT/io.github.paullo612.mlfx.api.CompiledFXMLLoader.load(CompiledFXMLLoader.java:133)
	at io.github.paullo612.mlfx.api.core@0.6.1-SNAPSHOT/io.github.paullo612.mlfx.api.MLFXLoader.load(MLFXLoader.java:310)
	at io.github.paullo612.mlfx.api.core@0.6.1-SNAPSHOT/io.github.paullo612.mlfx.api.MLFXLoader.load(MLFXLoader.java:63)
	at hellofxml/hellofx.HelloFXML.start(HelloFXML.java:50)
	at javafx.graphics@20/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:839)
	at javafx.graphics@20/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:483)
	at javafx.graphics@20/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at javafx.graphics@20/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455)
	at javafx.graphics@20/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
	at javafx.graphics@20/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at javafx.graphics@20/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:316)
	... 1 more
@Paullo612 Paullo612 self-assigned this May 26, 2023
@Paullo612 Paullo612 added the bug Something isn't working label May 26, 2023
Paullo612 added a commit that referenced this issue May 27, 2023
Do not blindly use ASM's swap method. Pass types that need to be
swapped as method arguments.

Task-number: #35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant