HaxeFoundation/hashlink

Single and hl.F32 function args for callMethod stack issue

rushmobius opened this issue · 1 comments

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');
    }
}

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