diff options
author | pem@mysql.comhem.se <> | 2003-11-13 19:34:56 +0100 |
---|---|---|
committer | pem@mysql.comhem.se <> | 2003-11-13 19:34:56 +0100 |
commit | c38bb3d79d1ad0e8d12334185530ce44ff8275af (patch) | |
tree | df91989d7134f7e1e4a3a6c110312d910b30c970 /sql | |
parent | d4b89f4210d789dababd7fc63f953f64ed1b775c (diff) | |
download | mariadb-git-c38bb3d79d1ad0e8d12334185530ce44ff8275af.tar.gz |
Various bug fixes:
- Duplicate parameters/variables, conditions and cursors (not allowed).
- ITERATE in labelled BEGIN-END (not allowed).
- Missing SQLSTATE [VALUE] keywords in CONDITION/HANDLER declaration (added).
- Empty BEGIN-END (now allowed).
- End label (now optional).
Diffstat (limited to 'sql')
27 files changed, 193 insertions, 37 deletions
diff --git a/sql/lex.h b/sql/lex.h index 8fbf504076b..f4368cacb5d 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -386,6 +386,7 @@ static SYMBOL symbols[] = { { "SPATIAL", SYM(SPATIAL_SYM),0,0}, { "SPECIFIC", SYM(SPECIFIC_SYM),0,0}, { "SQLEXCEPTION", SYM(SQLEXCEPTION_SYM),0,0}, + { "SQLSTATE", SYM(SQLSTATE_SYM),0,0}, { "SQLWARNING", SYM(SQLWARNING_SYM),0,0}, { "SQL_BIG_RESULT", SYM(SQL_BIG_RESULT),0,0}, { "SQL_BUFFER_RESULT", SYM(SQL_BUFFER_RESULT),0,0}, diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt index 7e992880c45..1f85a5fb84b 100644 --- a/sql/share/czech/errmsg.txt +++ b/sql/share/czech/errmsg.txt @@ -319,3 +319,4 @@ character-set=latin2 "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt index b2bb5f58525..f66b1492433 100644 --- a/sql/share/danish/errmsg.txt +++ b/sql/share/danish/errmsg.txt @@ -313,3 +313,4 @@ character-set=latin1 "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt index f8e5fafa198..d4ea5803390 100644 --- a/sql/share/dutch/errmsg.txt +++ b/sql/share/dutch/errmsg.txt @@ -321,3 +321,4 @@ character-set=latin1 "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt index 085a1e7389f..b52762aaac9 100644 --- a/sql/share/english/errmsg.txt +++ b/sql/share/english/errmsg.txt @@ -310,3 +310,4 @@ character-set=latin1 "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt index b70649390b6..18201380fbd 100644 --- a/sql/share/estonian/errmsg.txt +++ b/sql/share/estonian/errmsg.txt @@ -315,3 +315,4 @@ character-set=latin7 "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt index 10c3c72c371..c5912d59d23 100644 --- a/sql/share/french/errmsg.txt +++ b/sql/share/french/errmsg.txt @@ -310,3 +310,4 @@ character-set=latin1 "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt index 37d15882798..cc3a9d88a45 100644 --- a/sql/share/german/errmsg.txt +++ b/sql/share/german/errmsg.txt @@ -322,3 +322,4 @@ character-set=latin1 "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt index 9ea7b97f07f..b64a1971e35 100644 --- a/sql/share/greek/errmsg.txt +++ b/sql/share/greek/errmsg.txt @@ -310,3 +310,4 @@ character-set=greek "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt index 99246b28298..911cf3a09b6 100644 --- a/sql/share/hungarian/errmsg.txt +++ b/sql/share/hungarian/errmsg.txt @@ -312,3 +312,4 @@ character-set=latin2 "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt index 18ecc9e4539..152bd2dd922 100644 --- a/sql/share/italian/errmsg.txt +++ b/sql/share/italian/errmsg.txt @@ -310,3 +310,4 @@ character-set=latin1 "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt index e17cfa9c315..963642a6348 100644 --- a/sql/share/japanese/errmsg.txt +++ b/sql/share/japanese/errmsg.txt @@ -312,3 +312,4 @@ character-set=ujis "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt index 9e1e85c959b..7f721cd999e 100644 --- a/sql/share/korean/errmsg.txt +++ b/sql/share/korean/errmsg.txt @@ -310,3 +310,4 @@ character-set=euckr "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt index 798434f9720..ab9c428e3b0 100644 --- a/sql/share/norwegian-ny/errmsg.txt +++ b/sql/share/norwegian-ny/errmsg.txt @@ -312,3 +312,4 @@ character-set=latin1 "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt index 58f607b91ae..29e14d3b580 100644 --- a/sql/share/norwegian/errmsg.txt +++ b/sql/share/norwegian/errmsg.txt @@ -312,3 +312,4 @@ character-set=latin1 "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt index 4770cd5332e..c0caecfd5a0 100644 --- a/sql/share/polish/errmsg.txt +++ b/sql/share/polish/errmsg.txt @@ -314,3 +314,4 @@ character-set=latin2 "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt index e0d93563665..4044abdbcb2 100644 --- a/sql/share/portuguese/errmsg.txt +++ b/sql/share/portuguese/errmsg.txt @@ -311,3 +311,4 @@ character-set=latin1 "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt index d715847c27e..1fdcec122b8 100644 --- a/sql/share/romanian/errmsg.txt +++ b/sql/share/romanian/errmsg.txt @@ -314,3 +314,4 @@ character-set=latin2 "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt index d96a4fca293..9736cf23d2b 100644 --- a/sql/share/russian/errmsg.txt +++ b/sql/share/russian/errmsg.txt @@ -312,3 +312,4 @@ character-set=koi8r "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/serbian/errmsg.txt b/sql/share/serbian/errmsg.txt index cb6645dd67f..d95500183f0 100644 --- a/sql/share/serbian/errmsg.txt +++ b/sql/share/serbian/errmsg.txt @@ -305,3 +305,4 @@ character-set=cp1250 "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt index 6f1f6a7e267..2cf355e2659 100644 --- a/sql/share/slovak/errmsg.txt +++ b/sql/share/slovak/errmsg.txt @@ -318,3 +318,4 @@ character-set=latin2 "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt index ceb0458a2ac..53d3c26b990 100644 --- a/sql/share/spanish/errmsg.txt +++ b/sql/share/spanish/errmsg.txt @@ -312,3 +312,4 @@ character-set=latin1 "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt index bb2711fd0b3..ac9ac52c0f3 100644 --- a/sql/share/swedish/errmsg.txt +++ b/sql/share/swedish/errmsg.txt @@ -310,3 +310,4 @@ character-set=latin1 "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt index 5cdac39ce93..3e3e06d31ea 100644 --- a/sql/share/ukrainian/errmsg.txt +++ b/sql/share/ukrainian/errmsg.txt @@ -315,3 +315,4 @@ character-set=koi8u "Undeclared variable: %s" "Wrong number of FETCH variables" "No data to FETCH" +"Duplicate %s: %s" diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc index 3730230d47d..b7e23c9f5ad 100644 --- a/sql/sp_pcontext.cc +++ b/sql/sp_pcontext.cc @@ -32,6 +32,7 @@ sp_pcontext::sp_pcontext() VOID(my_init_dynamic_array(&m_pvar, sizeof(sp_pvar_t *), 16, 8)); VOID(my_init_dynamic_array(&m_cond, sizeof(sp_cond_type_t *), 16, 8)); VOID(my_init_dynamic_array(&m_cursor, sizeof(LEX_STRING), 16, 8)); + VOID(my_init_dynamic_array(&m_scopes, sizeof(sp_scope_t), 16, 8)); m_label.empty(); } @@ -41,23 +42,52 @@ sp_pcontext::destroy() delete_dynamic(&m_pvar); delete_dynamic(&m_cond); delete_dynamic(&m_cursor); + delete_dynamic(&m_scopes); m_label.empty(); } +void +sp_pcontext::push_scope() +{ + sp_scope_t s; + + s.vars= m_pvar.elements; + s.conds= m_cond.elements; + s.curs= m_cursor.elements; + insert_dynamic(&m_scopes, (gptr)&s); +} + +void +sp_pcontext::pop_scope() +{ + (void)pop_dynamic(&m_scopes); +} + /* This does a linear search (from newer to older variables, in case ** we have shadowed names). ** It's possible to have a more efficient allocation and search method, ** but it might not be worth it. The typical number of parameters and ** variables will in most cases be low (a handfull). -** And this is only called during parsing. +** ...and, this is only called during parsing. */ sp_pvar_t * -sp_pcontext::find_pvar(LEX_STRING *name) +sp_pcontext::find_pvar(LEX_STRING *name, my_bool scoped) { uint i = m_pvar.elements; + uint limit; - while (i-- > 0) + if (! scoped || m_scopes.elements == 0) + limit= 0; + else + { + sp_scope_t s; + + get_dynamic(&m_scopes, (gptr)&s, m_scopes.elements-1); + limit= s.vars; + } + + while (i-- > limit) { sp_pvar_t *p; @@ -101,6 +131,7 @@ sp_pcontext::push_label(char *name, uint ip) { lab->name= name; lab->ip= ip; + lab->isbegin= FALSE; m_label.push_front(lab); } return lab; @@ -137,11 +168,22 @@ sp_pcontext::push_cond(LEX_STRING *name, sp_cond_type_t *val) * See comment for find_pvar() above */ sp_cond_type_t * -sp_pcontext::find_cond(LEX_STRING *name) +sp_pcontext::find_cond(LEX_STRING *name, my_bool scoped) { uint i = m_cond.elements; + uint limit; - while (i-- > 0) + if (! scoped || m_scopes.elements == 0) + limit= 0; + else + { + sp_scope_t s; + + get_dynamic(&m_scopes, (gptr)&s, m_scopes.elements-1); + limit= s.conds; + } + + while (i-- > limit) { sp_cond_t *p; @@ -172,11 +214,22 @@ sp_pcontext::push_cursor(LEX_STRING *name) * See comment for find_pvar() above */ my_bool -sp_pcontext::find_cursor(LEX_STRING *name, uint *poff) +sp_pcontext::find_cursor(LEX_STRING *name, uint *poff, my_bool scoped) { uint i = m_cursor.elements; + uint limit; + + if (! scoped || m_scopes.elements == 0) + limit= 0; + else + { + sp_scope_t s; - while (i-- > 0) + get_dynamic(&m_scopes, (gptr)&s, m_scopes.elements-1); + limit= s.curs; + } + + while (i-- > limit) { LEX_STRING n; diff --git a/sql/sp_pcontext.h b/sql/sp_pcontext.h index 23be38edcbf..02134e3604f 100644 --- a/sql/sp_pcontext.h +++ b/sql/sp_pcontext.h @@ -42,6 +42,7 @@ typedef struct sp_label { char *name; uint ip; // Instruction index + my_bool isbegin; // For ITERATE error checking } sp_label_t; typedef struct sp_cond_type @@ -57,6 +58,11 @@ typedef struct sp_cond sp_cond_type_t *val; } sp_cond_t; +typedef struct sp_scope +{ + uint vars, conds, curs; +} sp_scope_t; + class sp_pcontext : public Sql_alloc { sp_pcontext(const sp_pcontext &); /* Prevent use of these */ @@ -70,6 +76,13 @@ class sp_pcontext : public Sql_alloc void destroy(); + // For error checking of duplicate things + void + push_scope(); + + void + pop_scope(); + // // Parameters and variables // @@ -130,7 +143,7 @@ class sp_pcontext : public Sql_alloc // Find by name sp_pvar_t * - find_pvar(LEX_STRING *name); + find_pvar(LEX_STRING *name, my_bool scoped=0); // Find by index sp_pvar_t * @@ -182,7 +195,7 @@ class sp_pcontext : public Sql_alloc } sp_cond_type_t * - find_cond(LEX_STRING *name); + find_cond(LEX_STRING *name, my_bool scoped=0); // // Handlers @@ -208,7 +221,7 @@ class sp_pcontext : public Sql_alloc push_cursor(LEX_STRING *name); my_bool - find_cursor(LEX_STRING *name, uint *poff); + find_cursor(LEX_STRING *name, uint *poff, my_bool scoped=0); inline void pop_cursor(uint num) @@ -233,6 +246,7 @@ private: DYNAMIC_ARRAY m_pvar; // Parameters/variables DYNAMIC_ARRAY m_cond; // Conditions DYNAMIC_ARRAY m_cursor; // Cursors + DYNAMIC_ARRAY m_scopes; // For error checking List<sp_label_t> m_label; // The label list diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 3eaaa4e1414..391cac37ceb 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -371,6 +371,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %token SPATIAL_SYM %token SPECIFIC_SYM %token SQLEXCEPTION_SYM +%token SQLSTATE_SYM %token SQLWARNING_SYM %token SSL_SYM %token STARTING @@ -618,7 +619,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); ULONGLONG_NUM field_ident select_alias ident ident_or_text UNDERSCORE_CHARSET IDENT_sys TEXT_STRING_sys TEXT_STRING_literal NCHAR_STRING opt_component - SP_FUNC ident_or_spfunc + SP_FUNC ident_or_spfunc sp_opt_label %type <lex_str_ptr> opt_table_alias @@ -1149,7 +1150,15 @@ sp_fdparams: sp_fdparam: ident type sp_opt_locator { - Lex->spcont->push_pvar(&$1, (enum enum_field_types)$2, sp_param_in); + LEX *lex= Lex; + sp_pcontext *spc= lex->spcont; + + if (spc->find_pvar(&$1, TRUE)) + { + net_printf(YYTHD, ER_SP_DUP_THING, "parameter", $1.str); + YYABORT; + } + spc->push_pvar(&$1, (enum enum_field_types)$2, sp_param_in); } ; @@ -1167,9 +1176,16 @@ sp_pdparams: sp_pdparam: sp_opt_inout ident type sp_opt_locator { - Lex->spcont->push_pvar(&$2, - (enum enum_field_types)$3, - (sp_param_mode_t)$1); + LEX *lex= Lex; + sp_pcontext *spc= lex->spcont; + + if (spc->find_pvar(&$2, TRUE)) + { + net_printf(YYTHD, ER_SP_DUP_THING, "parameter", $2.str); + YYABORT; + } + spc->push_pvar(&$2, (enum enum_field_types)$3, + (sp_param_mode_t)$1); } ; @@ -1186,7 +1202,7 @@ sp_opt_locator: ; sp_proc_stmts: - sp_proc_stmt ';' + /* Empty */ {} | sp_proc_stmts sp_proc_stmt ';' ; @@ -1231,6 +1247,14 @@ sp_decl: } | DECLARE_SYM ident CONDITION_SYM FOR_SYM sp_cond { + LEX *lex= Lex; + sp_pcontext *spc= lex->spcont; + + if (spc->find_cond(&$2, TRUE)) + { + net_printf(YYTHD, ER_SP_DUP_THING, "condition", $2.str); + YYABORT; + } YYTHD->lex->spcont->push_cond(&$2, $5); $$.vars= $$.hndlrs= $$.curs= 0; $$.conds= 1; @@ -1272,8 +1296,16 @@ sp_decl: { LEX *lex= Lex; sp_head *sp= lex->sphead; - sp_instr_cpush *i= new sp_instr_cpush(sp->instructions(), $5); + sp_pcontext *spc= lex->spcont; + uint offp; + sp_instr_cpush *i; + if (spc->find_cursor(&$2, &offp, TRUE)) + { + net_printf(YYTHD, ER_SP_DUP_THING, "cursor", $2.str); + YYABORT; + } + i= new sp_instr_cpush(sp->instructions(), $5); sp->add_instr(i); lex->spcont->push_cursor(&$2); $$.vars= $$.conds= $$.hndlrs= 0; @@ -1344,18 +1376,23 @@ sp_cond: $$->type= sp_cond_type_t::number; $$->mysqlerr= $1; } - | TEXT_STRING_literal + | SQLSTATE_SYM opt_value TEXT_STRING_literal { /* SQLSTATE */ - uint len= ($1.length < sizeof($$->sqlstate)-1 ? - $1.length : sizeof($$->sqlstate)-1); + uint len= ($3.length < sizeof($$->sqlstate)-1 ? + $3.length : sizeof($$->sqlstate)-1); $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); $$->type= sp_cond_type_t::state; - memcpy($$->sqlstate, $1.str, len); + memcpy($$->sqlstate, $3.str, len); $$->sqlstate[len]= '\0'; } ; +opt_value: + /* Empty */ {} + | VALUE_SYM {} + ; + sp_hcond: sp_cond { @@ -1390,12 +1427,28 @@ sp_hcond: sp_decl_idents: ident { - Lex->spcont->push_pvar(&$1, (enum_field_types)0, sp_param_in); + LEX *lex= Lex; + sp_pcontext *spc= lex->spcont; + + if (spc->find_pvar(&$1, TRUE)) + { + net_printf(YYTHD, ER_SP_DUP_THING, "parameter", $1.str); + YYABORT; + } + spc->push_pvar(&$1, (enum_field_types)0, sp_param_in); $$= 1; } | sp_decl_idents ',' ident { - Lex->spcont->push_pvar(&$3, (enum_field_types)0, sp_param_in); + LEX *lex= Lex; + sp_pcontext *spc= lex->spcont; + + if (spc->find_pvar(&$3, TRUE)) + { + net_printf(YYTHD, ER_SP_DUP_THING, "parameter", $3.str); + YYABORT; + } + spc->push_pvar(&$3, (enum_field_types)0, sp_param_in); $$= $1 + 1; } ; @@ -1532,7 +1585,7 @@ sp_proc_stmt: LEX *lex= Lex; sp_label_t *lab= lex->spcont->find_label($2.str); - if (! lab) + if (! lab || lab->isbegin) { net_printf(YYTHD, ER_SP_LILABEL_MISMATCH, "ITERATE", $2.str); YYABORT; @@ -1736,32 +1789,43 @@ sp_labeled_control: lex->sphead->instructions()); } } - sp_unlabeled_control IDENT + sp_unlabeled_control sp_opt_label { LEX *lex= Lex; - sp_label_t *lab= lex->spcont->find_label($5.str); - if (!lab || - my_strcasecmp(system_charset_info, $5.str, lab->name) != 0) + if ($5.str) { - net_printf(YYTHD, ER_SP_LABEL_MISMATCH, $5.str); - YYABORT; - } - else - { - lex->spcont->pop_label(); - lex->sphead->backpatch(lab); + sp_label_t *lab= lex->spcont->find_label($5.str); + + if (!lab || + my_strcasecmp(system_charset_info, $5.str, lab->name) != 0) + { + net_printf(YYTHD, ER_SP_LABEL_MISMATCH, $5.str); + YYABORT; + } } + lex->sphead->backpatch(lex->spcont->pop_label()); } ; +sp_opt_label: + /* Empty */ + { $$.str= NULL; $$.length= 0; } + | IDENT + { $$= $1; } + ; + sp_unlabeled_control: BEGIN_SYM { /* QQ This is just a dummy for grouping declarations and statements together. No [[NOT] ATOMIC] yet, and we need to figure out how make it coexist with the existing BEGIN COMMIT/ROLLBACK. */ + LEX *lex= Lex; + sp_label_t *lab= lex->spcont->last_label(); - Lex->spcont->push_label((char *)"", 0); /* For end of block */ + lab->isbegin= TRUE; + /* Scope duplicate checking */ + lex->spcont->push_scope(); } sp_decls sp_proc_stmts @@ -1771,7 +1835,7 @@ sp_unlabeled_control: sp_head *sp= lex->sphead; sp_pcontext *ctx= lex->spcont; - sp->backpatch(ctx->pop_label()); + sp->backpatch(ctx->last_label()); /* We always has a label */ ctx->pop_pvar($3.vars); ctx->pop_cond($3.conds); ctx->pop_cursor($3.curs); @@ -1779,6 +1843,7 @@ sp_unlabeled_control: sp->add_instr(new sp_instr_hpop(sp->instructions(),$3.hndlrs)); if ($3.curs) sp->add_instr(new sp_instr_cpop(sp->instructions(), $3.curs)); + ctx->pop_scope(); } | LOOP_SYM sp_proc_stmts END LOOP_SYM |