diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2020-06-08 14:26:49 +0900 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2020-06-09 09:52:46 +0900 |
commit | 1016cff4ff43d8977bda01cc59867e75ad238836 (patch) | |
tree | ba9a469a935fe4181117ed81e341fc9ce48957e1 | |
parent | ffe58b9c8bde9fa95e91a458e334b375a37ef974 (diff) |
rb_eql_opt,rb_equal_opt: purge stale cc
When on USE_EMBED_CI, cd is stored statically. Previous use could cache
stale cd->cc, which could have already been GCed. Need flush them.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3179
-rw-r--r-- | vm_insnhelper.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 11e03f853d..65bebd34e8 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1799,15 +1799,14 @@ rb_equal_opt(VALUE obj1, VALUE obj2) #if USE_EMBED_CI static struct rb_call_data cd = { .ci = vm_ci_new_id(idEq, 0, 1, 0), - .cc = &vm_empty_cc, }; #else struct rb_call_data cd = { .ci = &VM_CI_ON_STACK(idEq, 0, 1, 0), - .cc = &vm_empty_cc, }; #endif + cd.cc = &vm_empty_cc; return opt_equality(NULL, obj1, obj2, &cd); } @@ -1819,15 +1818,14 @@ rb_eql_opt(VALUE obj1, VALUE obj2) #if USE_EMBED_CI static struct rb_call_data cd = { .ci = vm_ci_new_id(idEqlP, 0, 1, 0), - .cc = &vm_empty_cc, }; #else struct rb_call_data cd = { .ci = &VM_CI_ON_STACK(idEqlP, 0, 1, 0), - .cc = &vm_empty_cc, }; #endif + cd.cc = &vm_empty_cc; return opt_equality(NULL, obj1, obj2, &cd); } #endif |