You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
'attention: LUA uses a default param of "0"
'-> so for this and other functions we have to use "<=0" instead of "<0"
Method GetDay:Int(useTime:Double = -1) {_exposeToLua}
print "useTime="+useTime
Return useTime * 10
End Method
The text was updated successfully, but these errors were encountered:
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:
The text was updated successfully, but these errors were encountered: