reflaxe.CPP icon indicating copy to clipboard operation
reflaxe.CPP copied to clipboard

Order of evaluation of function parameters does not match Haxe's order of evaluation

Open RandomityGuy opened this issue 1 year ago • 0 comments

Compiler Configuration: MSVC 2022, Windows, 64 bit, Release Build

This was a great project to just integrate one of my existing Haxe libraries in one of my C++ projects since I didn't wanna drag entirety of hxcpp into it. However I was able to determine that the order of evaluation of passed function parameters didn't match with Haxe's. Example: Haxe side: image The expected evaluation order is io.readInt16() and then io.readFloat() which works fine Haxe side, even when the library is compiled to hl/c.

Generated C++ code: image I inspected using a debugger and found that io->readFloat() gets called first and then io->readInt16(), leading to wrong values being set to the fields of the object.

I'm not sure if this is a behavior due to Release build optimizations but I think the order of evaluation should ideally be preserved, which is not the case currently. Thanks.

RandomityGuy avatar Oct 21 '24 14:10 RandomityGuy