mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
eval_jump.c: refix [Bug #9110]
* eval_jump.c (rb_exec_end_proc): unlink and free procs data before calling for each procs. [Bug #9110] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
eba3d83f4e
commit
ecbdd8fcad
2 changed files with 13 additions and 15 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Mon Nov 18 22:45:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* eval_jump.c (rb_exec_end_proc): unlink and free procs data before
|
||||||
|
calling for each procs. [Bug #9110]
|
||||||
|
|
||||||
Sun Nov 17 06:33:32 2013 Shota Fukumori <her@sorah.jp>
|
Sun Nov 17 06:33:32 2013 Shota Fukumori <her@sorah.jp>
|
||||||
|
|
||||||
* configure.in: Use $LIBS for base of $SOLIBS, also in darwin.
|
* configure.in: Use $LIBS for base of $SOLIBS, also in darwin.
|
||||||
|
|
23
eval_jump.c
23
eval_jump.c
|
@ -96,9 +96,8 @@ rb_mark_end_proc(void)
|
||||||
void
|
void
|
||||||
rb_exec_end_proc(void)
|
rb_exec_end_proc(void)
|
||||||
{
|
{
|
||||||
struct end_proc_data *volatile link;
|
struct end_proc_data volatile endproc;
|
||||||
struct end_proc_data *ephemeral_end_procs_head = ephemeral_end_procs;
|
struct end_proc_data volatile *link;
|
||||||
struct end_proc_data *end_procs_head = end_procs;
|
|
||||||
int status;
|
int status;
|
||||||
volatile int safe = rb_safe_level();
|
volatile int safe = rb_safe_level();
|
||||||
rb_thread_t *th = GET_THREAD();
|
rb_thread_t *th = GET_THREAD();
|
||||||
|
@ -107,6 +106,9 @@ rb_exec_end_proc(void)
|
||||||
while (ephemeral_end_procs) {
|
while (ephemeral_end_procs) {
|
||||||
link = ephemeral_end_procs;
|
link = ephemeral_end_procs;
|
||||||
ephemeral_end_procs = link->next;
|
ephemeral_end_procs = link->next;
|
||||||
|
endproc = *link;
|
||||||
|
xfree((void *)link);
|
||||||
|
link = &endproc;
|
||||||
|
|
||||||
PUSH_TAG();
|
PUSH_TAG();
|
||||||
if ((status = EXEC_TAG()) == 0) {
|
if ((status = EXEC_TAG()) == 0) {
|
||||||
|
@ -123,6 +125,9 @@ rb_exec_end_proc(void)
|
||||||
while (end_procs) {
|
while (end_procs) {
|
||||||
link = end_procs;
|
link = end_procs;
|
||||||
end_procs = link->next;
|
end_procs = link->next;
|
||||||
|
endproc = *link;
|
||||||
|
xfree((void *)link);
|
||||||
|
link = &endproc;
|
||||||
|
|
||||||
PUSH_TAG();
|
PUSH_TAG();
|
||||||
if ((status = EXEC_TAG()) == 0) {
|
if ((status = EXEC_TAG()) == 0) {
|
||||||
|
@ -136,18 +141,6 @@ rb_exec_end_proc(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
link = ephemeral_end_procs_head;
|
|
||||||
while (link) {
|
|
||||||
xfree(link);
|
|
||||||
link = link->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
link = end_procs_head;
|
|
||||||
while (link) {
|
|
||||||
xfree(link);
|
|
||||||
link = link->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
rb_set_safe_level_force(safe);
|
rb_set_safe_level_force(safe);
|
||||||
th->errinfo = errinfo;
|
th->errinfo = errinfo;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue