|Anonymous | Login | Signup for a new account||2022-01-17 12:24 PST|
|Main | My View | View Issues | Change Log | Roadmap | Summary | My Account|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005905||opensim||[REGION] Scripting Engine||public||2012-02-22 11:43||2022-01-04 14:54|
|Platform||Operating System||Operating System Version|
|Target Version||Fixed in Version||0.9.2.0|
|Summary||0005905: Incorrect LSL syntax code dont trigger LSL error.|
|Description||If i use the following example program in opensim:|
string message = "Colors-256";
if (llStringLength(llGetSubString(message, 0, 6))=="Colors-")
everything works fine. If i copy the same lsl program to Secondlife i get a
(6 , 68 ) : ERROR : Type Mismatch.
That error is complete correct. because the right code would be
string message = "Colors-256";
if (llGetSubString(message, 0, 6)=="Colors-")
The problem is (user error) i try to compare integer with string.
other words " Function: integer llStringLength( string str ); "
Opensim seems to be relaxed with this code mistake , it works fine. but SL tels you that its wrong, and that make more sense, you cant compare integer with string i the IF line.
|Tags||No tags attached.|
|Git Revision or version number||a27e5a9c956be2150d52340543b5eec74a76f28d|
|Run Mode||Grid (1 Region per Sim)|
|Environment||Mono / Linux64|
Things only seemed to be fine.
code just did compile because of abusive automatic casting, including some strange one
same example will not compile on 0.9.2.0 Yengine, but will do the same on X
Note that restricted casting is only a way to help to detect programming errors
The code above is just a bad programming error, that just happens to be detected because the now illegal automatic casting
To add. When specifically typecasting to string aka
if ((string)llStringLength(llGetSubString(message, 0, 6))=="Colors-")
the eval correctly returns false as "7" != "Colors-"
Questionable if this can be resolved in X and of course the is the potential to "break" existing scripts as well if done.
Y correctly throws a compile error on comparing string and int as it should.
edited on: 2022-01-04 12:31
TBH, I wouldn't fix it in XEngine, as even if this obviously is a programming mistake - It shouldn't be solved. At most, not sure if, one can just print a warning, but not make it fail the compilation.
Warnings IMHO are useful for such things. It'd be worth to have that, but I am not sure if viewers are capable of that.
edited on: 2022-01-04 18:08
No.. it will stay as is on XEngine to avoid issues with scripts that some how work on it.
But YEngine is more restrictive, for the reasons this just exemplifies
|Y is now default as well. Fixing in X might be possible, but not without some gymnastics and who knows what that does to existing scripts. Marking as resolved.|
|2012-02-22 11:43||Digi Fly||New Issue|
|2022-01-04 09:27||UbitUmarov||Note Added: 0038311|
|2022-01-04 09:35||tampa||Note Added: 0038312|
|2022-01-04 12:30||evilissimo||Note Added: 0038313|
|2022-01-04 12:31||evilissimo||Note Edited: 0038313||View Revisions|
|2022-01-04 12:58||UbitUmarov||Note Added: 0038314|
|2022-01-04 14:54||tampa||Mono Version||2.10 => 6.x|
|2022-01-04 14:54||tampa||Note Added: 0038315|
|2022-01-04 14:54||tampa||Status||new => resolved|
|2022-01-04 14:54||tampa||Fixed in Version||=> 0.9.2.0|
|2022-01-04 14:54||tampa||Resolution||open => not fixable|
|2022-01-04 14:54||tampa||Assigned To||=> tampa|
|2022-01-04 18:08||UbitUmarov||Note Edited: 0038314||View Revisions|
|Copyright © 2000 - 2012 MantisBT Group|