forked from pclewis/lslint
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add warning for (list)string_var or (list)key_var in LSO
See scripts/lso/liststrkey.lsl test case for motivation. Closes #35.
- Loading branch information
Showing
6 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
default | ||
{ | ||
state_entry() | ||
{ | ||
key k = llGetObjectName(); | ||
string s = llGetKey(); | ||
|
||
list ls = | ||
(list) // $[E20021] could result in a string | ||
k; | ||
ls = ls + | ||
(list) // $[E20021] could result in a key | ||
s; | ||
|
||
if (llGetListEntryType(ls, 0) == TYPE_STRING | ||
&& llGetListEntryType(ls, 1) == TYPE_KEY) | ||
{ | ||
// This is printed! | ||
llOwnerSay("LSO has weird bugs"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
default | ||
{ | ||
state_entry() | ||
{ | ||
key k = llGetObjectName(); | ||
string s = llGetKey(); | ||
|
||
list ls = (list)k; // no E20021 in mono | ||
ls = ls + (list)s; // no E20021 in mono | ||
|
||
if (llGetListEntryType(ls, 0) != TYPE_STRING | ||
&& llGetListEntryType(ls, 1) != TYPE_KEY) | ||
{ | ||
// Not printed in Mono | ||
llOwnerSay("Mono is safe"); | ||
} | ||
} | ||
} |