diff --git a/lslmini.y b/lslmini.y index 256794a..19faff1 100644 --- a/lslmini.y +++ b/lslmini.y @@ -242,18 +242,14 @@ globals } | global globals { - if ( $1 ) { + if ( $1 && $2 ) { DEBUG( LOG_DEBUG_SPAM, NULL, "** global [%p,%p] globals [%p,%p]\n", $1->get_prev(), $1->get_next(), $2->get_prev(), $2->get_next()); $1->add_next_sibling($2); $$ = $1; } else { - $$ = $2; + $$ = $2 ? $2 : $1; } } - | error ';' - { - $$ = NULL; - } ; global @@ -265,6 +261,10 @@ global { $$ = new LLScriptGlobalStorage(NULL, $1); } + | error ';' + { + $$ = NULL; + } ; name_type diff --git a/scripts/bugs/0079a.lsl b/scripts/bugs/0079a.lsl new file mode 100644 index 0000000..061c90b --- /dev/null +++ b/scripts/bugs/0079a.lsl @@ -0,0 +1,3 @@ +integer a; // $[E20009] Declared but not used +b; // $[E10019] Syntax error (it was causing a segfault) +default { state_entry() {} } diff --git a/scripts/bugs/0079b.lsl b/scripts/bugs/0079b.lsl new file mode 100644 index 0000000..4adebc1 --- /dev/null +++ b/scripts/bugs/0079b.lsl @@ -0,0 +1,4 @@ +integer a; // $[E20009] Declared and not used +b; // $[E10019] Syntax error +integer c; // $[E20009] Declared and not used +default { state_entry() {} }