Skip to content

Commit

Permalink
Merge pull request #75 from Sei-Lisa/sei-fix-missing-symbol-crash
Browse files Browse the repository at this point in the history
Define the symbol anyway when a declaration appears at an illegal place
  • Loading branch information
Makopo authored Mar 20, 2018
2 parents 464a28d + fc84d49 commit 3d78585
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lslmini.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ void LLScriptDeclaration::define_symbols() {
if ( type == NODE_IF_STATEMENT || type == NODE_FOR_STATEMENT
|| type == NODE_DO_STATEMENT || type == NODE_WHILE_STATEMENT) {
ERROR( HERE, E_DECLARATION_NOT_ALLOWED );
return;
// fall through to define the symbol anyway (issue #73)
}
LLScriptIdentifier *identifier = (LLScriptIdentifier *)get_children();
identifier->set_symbol( new LLScriptSymbol(identifier->get_name(), identifier->get_type(), SYM_VARIABLE, SYM_LOCAL, identifier->get_lloc()) );
Expand Down
6 changes: 6 additions & 0 deletions scripts/bugs/0073.lsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
default{timer(){
if (llGetLinkNumber())
integer // $[E10036] Declaration needs braces {}
i // $[E20009] Declared but not used
= 0;
}}
2 changes: 1 addition & 1 deletion scripts/scope3.lsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ default {
integer test = 1; // works fine
test();
test = 2;
if (llGetAttached()) integer test; // $[E10036], but no E10001
if (llGetAttached()) integer test; // $[E10036], $[E10001]
}
}

0 comments on commit 3d78585

Please sign in to comment.