Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008627opensim[REGION] Scripting Enginepublic2019-11-12 23:482019-11-14 07:34
ReporterKayaker Magic 
Assigned To 
PlatformLinux MonoOSOpenSim OS Version0.9.1.1.Yeti Dev
Product Version0.9.1.0 
Target VersionFixed in Version 
Summary0008627: YEngine gives reference error for logic == expressions
DescriptionSeveral 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 InformationI'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 Snail Release and the error is still happening!
TagsNo tags attached.
Git Revision or version number435c30c038f9cdd96a2e9915554ef8efe7014614
Run Mode Grid (Multiple Regions per Sim)
Physics EngineubODE
Script EngineYEngine
EnvironmentMono / Linux64
Mono Version6.x
Attached Files

- Relationships

-  Notes
tampa (reporter)
2019-11-13 04:15

That does not seem like a reasonable thing to do and since that is effectively if(TRUE) why not use that?
piusnoel (reporter)
2019-11-13 04:53

Because it might break existing scripts you even don't have access to.
tampa (reporter)
2019-11-13 04:56

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)
2019-11-13 10:24

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.
UbitUmarov (administrator)
2019-11-13 13:07

this seems to be only a Constant compareOP Constant issue right?
( compareOP beening == <= etc)
UbitUmarov (administrator)
2019-11-13 15:29

made changes on master.
note that string compareOp string with
compareop diferent than '==' will work unlike standard
following c# strings order
Kayaker Magic (reporter)
2019-11-14 00:31

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!".
UbitUmarov (administrator)
2019-11-14 07:34

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

- Issue History
Date Modified Username Field Change
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
Powered by Mantis Bugtracker