Open GWRon opened 3 years ago
Replacing the parameter with other types makes it work (I had it on "double" before rewriting my stuff to use longs for times not doubles).
As stated in #227 issues arise also for "doubles" - if you do debug builds instead of release builds.
I received a bug report by a user ... somehow a lua script which invokes some BlitzMax-exposed method received wrong values.
I am not able to replicate it on my computers (linux, windows7, windows10, AMD and Intel cpus).
If building a 64bit binary for him, the problem is gone. It only happens for 32bit builds. That user had other special "results" when I used "long" in c code rather than "BBLONG" (fixed thanks to @HurryStarfish ).
The method is defined as
Method GetDay:Int(useTime:Long = -1)
- so the parameter is a LONG. I call the method via reflection. Before invoking the method I print out the "to pass" parameters. Inside the method I print out what is received - and what is returned at the end. After invokation is done I print out what was returned.Lua -> BlitzMax works. So param is read as it should. The invoked method receives an incorrect value .. .and calculates with it. It returns a value (which it printed out). The value the invocation result contains is different to the printed out one.
I cannot write up a simple example but something like this can help: