summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
diff options
context:
space:
mode:
authorJon Olav Hauglid <jon.hauglid@oracle.com>2012-01-09 11:33:26 +0100
committerJon Olav Hauglid <jon.hauglid@oracle.com>2012-01-09 11:33:26 +0100
commit63a0c3078b708bb7f985e33d22e5127244466aff (patch)
treea7aa2696cedf959b55bf3d17f88c037baee0e837 /sql/sp_head.cc
parent86701392fcc4950056e9b28a8ce140c660a5df5f (diff)
parent6c1bbb50cb9ee124e762f66004a3daad297e6d6f (diff)
downloadmariadb-git-63a0c3078b708bb7f985e33d22e5127244466aff.tar.gz
Merge from mysql-5.1-security to mysql-5.5-security
Text conflict in sql/sql_yacc.yy
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r--sql/sp_head.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index eb29590b700..2763be7a4aa 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -3559,6 +3559,23 @@ sp_instr_hpush_jump::opt_mark(sp_head *sp, List<sp_instr> *leads)
m_optdest= sp->get_instr(m_dest);
}
sp->add_mark_lead(m_dest, leads);
+
+ /*
+ For continue handlers, all instructions in the scope of the handler
+ are possible leads. For example, the instruction after freturn might
+ be executed if the freturn triggers the condition handled by the
+ continue handler.
+
+ m_dest marks the start of the handler scope. It's added as a lead
+ above, so we start on m_dest+1 here.
+ m_opt_hpop is the hpop marking the end of the handler scope.
+ */
+ if (m_type == SP_HANDLER_CONTINUE)
+ {
+ for (uint scope_ip= m_dest+1; scope_ip <= m_opt_hpop; scope_ip++)
+ sp->add_mark_lead(scope_ip, leads);
+ }
+
return m_ip+1;
}