LSL-Editor/Bugs

From Second Life Wiki
< LSL-Editor
Revision as of 10:17, 14 September 2007 by Huney Jewell (talk | contribs) (Flaw: Use of unassigned local variable)
Jump to navigation Jump to search

LSL Alternate Editors lists a number of alternate worlds that work much like the world shown by the Second Life client, including the world of the binary-code-only LSL-Editor for Windows in particular.

In this article we blog differences found between the Second Life implementation of the Linden Scripting Language (LSL) and the LSL-Editor implementation.

By definition, differences found are merely issues, not definitely bugs, until we understand them. Different results seen with a test case are bugs in the implementations or in the specifications. The differences are bugs in the implementations if the specifications say what the implementation should do in the test case, differences are bugs in the specifications if the the specifications don't mention the test case, differences are broken by design if the specification lets the implementation behave indeterminately.

Cast of Cast Syntax

I tested ... offline using LSLEditor 2.15 and got the results I documented ...

Q1. ... Do LSLEditor 2.15 and Second Life 2007-09-12 disagree?

A1a. I checked it in-world and yes, ...

A1b. I checked again with LSLEditor and they really disagree on these results. And it's not the only difference.

This term ie. worked correctly in LSLEditor:
float number;
string char = (string)(integer)float;

which didnt compile in-world and needed be changed to
float number;
string char = (string)((integer)float);

which in LSLEditor worked correctly, too.

-- first posted as chat by Huney Jewell and Ppaatt Lynagh at User_talk:Ppaatt_Lynagh in September 2007

Separate Words Results Involving llParseString2List etc.

I tested Separate Words offline using LSLEditor 2.15 and got the results I documented ...

Q1. Are the results I got not the results that everyone gets in world?? Do LSLEditor 2.15 and Second Life 2007-09-12 disagree?

A1a. I checked it in-world and yes, ...

-- first posted as chat by Huney Jewell and Ppaatt Lynagh at User_talk:Ppaatt_Lynagh in September 2007

Use of unassigned local variable

Another flaw:

This code produces above error msg with LSLEditor 2.16:

string msg()
{
	float value;
	if (TRUE)
		value = 1;
	else if (FALSE)
		value = 0;
	return (string)value;
}

default
{
	state_entry()
	{
		llOwnerSay(msg());
	}
}

This runs without error:

string msg()
{
	float value;
	if (TRUE)
		value = 1;
	else
		value = 0;
	return (string)value;
}

default
{
	state_entry()
	{
		llOwnerSay(msg());
	}
}

and this is without error, too:

string msg()
{
	string value;
	if (TRUE)
		value = "1";
	else if (FALSE)
		value = "0";
	return value;
}

default
{
	state_entry()
	{
		llOwnerSay(msg());
	}
}

-- posted by Huney Jewell in September 2007