|Anonymous | Login | Signup for a new account||2020-09-25 22:22 PDT|
|Main | My View | View Issues | Change Log | Roadmap | Summary | My Account|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0008627||opensim||[REGION] Scripting Engine||public||2019-11-12 23:48||2019-11-14 07:34|
|Platform||Linux Mono||OS||OpenSim||OS Version||0.9.1.1.Yeti Dev|
|Target Version||Fixed in Version|
|Summary||0008627: YEngine gives reference error for logic == expressions|
|Description||Several scripts of mine that worked fine in earlier versions of OpenSim/YEngine are now reporting an error on compile:|
"Error: Object reference not set to an instance of an object"
I found the simplest example that gets this error is:
if (0 == 0)
This is simplified from the original code where the first 0 was an integer expression that I was testing for 0. But even comparing 0 with itself generages that reference/instance error.
|Additional Information||I'm unsure when the error appeared, the scripts were not generating errors on a dev master version from several weeks ago. I tried this little script in 0.9.1.0 Snail Release and the error is still happening!|
|Tags||No tags attached.|
|Git Revision or version number||435c30c038f9cdd96a2e9915554ef8efe7014614|
|Run Mode||Grid (Multiple Regions per Sim)|
|Environment||Mono / Linux64|
|That does not seem like a reasonable thing to do and since that is effectively if(TRUE) why not use that?|
|Because it might break existing scripts you even don't have access to.|
|If a script contains if (0 == 0) or (TRUE) I think there are bigger issues to solve than that, because that is a non-sensical thing to do frankly.|
Kayaker Magic (reporter)
My scripts do not conatain if (0 == 0). They contain
if ((complicated logical expression calling LSL bunctions)==0)
But I was able to simplify them to (0 == 0) and still get an error from the compiler.
this seems to be only a Constant compareOP Constant issue right?
( compareOP beening == <= etc)
made changes on master.
note that string compareOp string with
compareop diferent than '==' will work unlike standard
following c# strings order
Kayaker Magic (reporter)
Yes, this is a problem with comparOP Constant! And it is fixed, thank you.
Looking back at my original code that got the error, it looked something like:
if (a&CONST == 0)
According to the LL wiki, the == will be done first, which is two constants being compared. If the code is re-written to say:
if ((a&CONST) ==0)
Then there is no error. So the error yesterday is a reminder to add parentheses! I re-built and installed the new version of OpenSim (commit 45625a02a214d61dfc549d56c4a4daa44369f225) and I no longer see the error on the first if statement above. Now that I understand it is an issue with constants only, I wish you had left the error in, but changed the message to "you should fully parenthesize your if statements!".
yes a&CONST == 0 is silly
a trap for those used to left -> right parsing
always good idea to use, even abuse of () to enforce priority, and on any language
( something i also forget ;) )
|2019-11-12 23:48||Kayaker Magic||New Issue|
|2019-11-12 23:56||Kayaker Magic||Description Updated||View Revisions|
|2019-11-13 00:05||Kayaker Magic||Git Revision or version number||=> 435c30c038f9cdd96a2e9915554ef8efe7014614|
|2019-11-13 00:05||Kayaker Magic||Additional Information Updated||View Revisions|
|2019-11-13 00:24||Kayaker Magic||Additional Information Updated||View Revisions|
|2019-11-13 04:15||tampa||Note Added: 0035853|
|2019-11-13 04:53||piusnoel||Note Added: 0035854|
|2019-11-13 04:56||tampa||Note Added: 0035855|
|2019-11-13 10:24||Kayaker Magic||Note Added: 0035857|
|2019-11-13 13:07||UbitUmarov||Note Added: 0035858|
|2019-11-13 15:29||UbitUmarov||Note Added: 0035859|
|2019-11-14 00:31||Kayaker Magic||Note Added: 0035861|
|2019-11-14 00:32||Kayaker Magic||Status||new => resolved|
|2019-11-14 07:34||UbitUmarov||Note Added: 0035875|
|Copyright © 2000 - 2012 MantisBT Group|