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

Single and hl.F32 function args for callMethod stack issue #670

Closed
rushmobius opened this issue Mar 27, 2024 · 1 comment
Closed

Single and hl.F32 function args for callMethod stack issue #670

rushmobius opened this issue Mar 27, 2024 · 1 comment

Comments

@rushmobius
Copy link

rushmobius commented Mar 27, 2024

Invoking a Reflect.callMethod where an arg is a Single/hl.F32 results in 0 being passed in.
Wondering if the stack setup in callback_c2hl isn't handling HF32 correctly?
This is on hashlink 1.14 and haxe 4.3.4

Quick code example to repro

class Test
{
    public static function main():Void
    {
        var test = new Test();

        var x:Single = 10;
        var y:Single = 20;
        trace('$x, $y'); // outputs 10.0,20.0 as expected

        var f = Reflect.field(test, "foo");

        Reflect.callMethod(test, f, [x, y]); // outputs 0, 0
    }

    public function new()
    {
    }

    public function foo(x:Single, y:Single):Void
    {
        trace('$x, $y');
    }
}
@rushmobius
Copy link
Author

rushmobius commented Mar 28, 2024

It seems changing the HF32 case in jit,c callback_c2hl to just be
*(float*)store = *(float*)v;
instead of double works for me

GlassySundew pushed a commit to GlassySundew/hashlink that referenced this issue May 11, 2024
RandomityGuy pushed a commit to RandomityGuy/hashlink that referenced this issue Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant