revert r43675 and r43683 without tests for applying rollback patch.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7664609f92
commit
9e96b1edea
12
ChangeLog
12
ChangeLog
@ -5,13 +5,6 @@ Sat Nov 16 00:18:36 2013 Masaki Matsushita <glass.saga@gmail.com>
|
|||||||
|
|
||||||
* test/ruby/test_beginendblock.rb: test for above.
|
* test/ruby/test_beginendblock.rb: test for above.
|
||||||
|
|
||||||
Fri Nov 15 22:21:34 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|
||||||
|
|
||||||
* hash.c (hash_foreach_iter, hash_foreach_ensure, rb_hash_foreach):
|
|
||||||
deal with iteration level when reentering by callcc. temporary
|
|
||||||
measure until rollback of ensure is introduced. [ruby-dev:47807]
|
|
||||||
[Bug #9105]
|
|
||||||
|
|
||||||
Fri Nov 15 17:07:31 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Nov 15 17:07:31 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* lib/delegate.rb (Delegator#send): override to get rid of global function interference.
|
* lib/delegate.rb (Delegator#send): override to get rid of global function interference.
|
||||||
@ -45,10 +38,7 @@ Thu Nov 14 19:53:00 2013 Tanaka Akira <akr@fsij.org>
|
|||||||
EVP_CIPHER_CTX_ctrl (and internally aes_gcm_ctrl) fail.
|
EVP_CIPHER_CTX_ctrl (and internally aes_gcm_ctrl) fail.
|
||||||
[ruby-core:55143] [Bug #8439] reported by Vit Ondruch.
|
[ruby-core:55143] [Bug #8439] reported by Vit Ondruch.
|
||||||
|
|
||||||
Thu Nov 14 11:35:37 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Thu Nov 14 11:33:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* hash.c (hash_foreach_ensure): restore iter_lev to the previous
|
|
||||||
value, not just decrement. [ruby-dev:47803] [Bug #9105]
|
|
||||||
|
|
||||||
* hash.c (foreach_safe_i, hash_foreach_iter): deal with error detected
|
* hash.c (foreach_safe_i, hash_foreach_iter): deal with error detected
|
||||||
by ST_CHECK.
|
by ST_CHECK.
|
||||||
|
18
hash.c
18
hash.c
@ -173,7 +173,6 @@ struct hash_foreach_arg {
|
|||||||
VALUE hash;
|
VALUE hash;
|
||||||
rb_foreach_func *func;
|
rb_foreach_func *func;
|
||||||
VALUE arg;
|
VALUE arg;
|
||||||
VALUE marker;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -189,10 +188,6 @@ hash_foreach_iter(st_data_t key, st_data_t value, st_data_t argp, int error)
|
|||||||
if (RHASH(arg->hash)->ntbl != tbl) {
|
if (RHASH(arg->hash)->ntbl != tbl) {
|
||||||
rb_raise(rb_eRuntimeError, "rehash occurred during iteration");
|
rb_raise(rb_eRuntimeError, "rehash occurred during iteration");
|
||||||
}
|
}
|
||||||
if (DATA_PTR(arg->marker)) {
|
|
||||||
RHASH_ITER_LEV(arg->hash)++;
|
|
||||||
DATA_PTR(arg->marker) = 0;
|
|
||||||
}
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case ST_DELETE:
|
case ST_DELETE:
|
||||||
FL_SET(arg->hash, HASH_DELETED);
|
FL_SET(arg->hash, HASH_DELETED);
|
||||||
@ -206,14 +201,8 @@ hash_foreach_iter(st_data_t key, st_data_t value, st_data_t argp, int error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
hash_foreach_ensure(VALUE arg)
|
hash_foreach_ensure(VALUE hash)
|
||||||
{
|
{
|
||||||
struct hash_foreach_arg *argp = (struct hash_foreach_arg *)arg;
|
|
||||||
VALUE hash = argp->hash;
|
|
||||||
|
|
||||||
if (DATA_PTR(argp->marker)) return 0;
|
|
||||||
DATA_PTR(argp->marker) = (void *)-1;
|
|
||||||
|
|
||||||
if (--RHASH_ITER_LEV(hash) == 0) {
|
if (--RHASH_ITER_LEV(hash) == 0) {
|
||||||
if (FL_TEST(hash, HASH_DELETED)) {
|
if (FL_TEST(hash, HASH_DELETED)) {
|
||||||
st_cleanup_safe(RHASH(hash)->ntbl, (st_data_t)Qundef);
|
st_cleanup_safe(RHASH(hash)->ntbl, (st_data_t)Qundef);
|
||||||
@ -240,12 +229,11 @@ rb_hash_foreach(VALUE hash, int (*func)(ANYARGS), VALUE farg)
|
|||||||
|
|
||||||
if (!RHASH(hash)->ntbl)
|
if (!RHASH(hash)->ntbl)
|
||||||
return;
|
return;
|
||||||
|
RHASH_ITER_LEV(hash)++;
|
||||||
arg.hash = hash;
|
arg.hash = hash;
|
||||||
arg.func = (rb_foreach_func *)func;
|
arg.func = (rb_foreach_func *)func;
|
||||||
arg.arg = farg;
|
arg.arg = farg;
|
||||||
arg.marker = Data_Wrap_Struct(0, 0, 0, 0);
|
rb_ensure(hash_foreach_call, (VALUE)&arg, hash_foreach_ensure, hash);
|
||||||
RHASH_ITER_LEV(hash)++;
|
|
||||||
rb_ensure(hash_foreach_call, (VALUE)&arg, hash_foreach_ensure, (VALUE)&arg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user