HaxeFoundation / HaxeFoundation/haxe

[JVM] Bad local variable type

Open
#12,916 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

```haxe
_leftButton = new FlxMouseButton(FlxMouseButtonID.LEFT);
```
https://github.com/HaxeFlixel/flixel/blob/f05c2c38c8489bec7b2eba38a25d04e20f82f6d7/flixel/input/mouse/FlxMouse.hx#L487
```ex
Called from flixel.input.mouse.FlxMouse. (/usr/local/lib/haxe/lib/flixel/6,1,2/flixel/input/mouse/FlxMouse.hx line 487)
Called from flixel.FlxG.init (/usr/local/lib/haxe/lib/flixel/6,1,2/flixel/FlxG.hx line 558)
Called from flixel.FlxGame.new (/usr/local/lib/haxe/lib/flixel/6,1,2/flixel/FlxGame.hx line 260)
Called from haxe.root.Main.new (source/Main.hx line 11)
Called from haxe.root.DocumentClass.new (export/jvm/haxe/ApplicationMain.hx line 343)
Called from haxe.root.ApplicationMain.start (export/jvm/haxe/ApplicationMain.hx line 221)
java.lang.VerifyError: Bad local variable type
Exception Details:
Location:
flixel/input/mouse/FlxMouseButton.(Ljava/lang/Object;)V @44: aload_1
Reason:
Type double (current frame, locals[1]) is not assignable to reference type
Current Frame:
bci: @44
flags: { flagThisUninit }
locals: { uninitializedThis, double, double_2nd, double, double_2nd, 'flixel/math/FlxBasePoint' }
stack: { uninitializedThis }
Bytecode:
0000000: 2a2a 0e48 0e4a b200 62b6 0068 c000 4027
0000010: b800 3529 b800 35b6 0044 3a05 1905 03b5
0000020: 006c 1905 b500 2a2a 02b5 0050 2bb7 009b
0000030: b1
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the JVM target failure while initializing flixel.input.mouse.FlxMouse, starting from flixel/input/mouse/FlxMouse.hx line 487 and the FlxMouseButton constructor shown in the verifier output. Inspect the generated constructor bytecode and the Haxe compiler's JVM code-generation path; done means the program starts without java.lang.VerifyError and the reported local-variable type is valid.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.