ruby-changes:61629
From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Tue, 9 Jun 2020 09:53:26 +0900 (JST)
Subject: [ruby-changes:61629] 1016cff4ff (master): rb_eql_opt, rb_equal_opt: purge stale cc
https://git.ruby-lang.org/ruby.git/commit/?id=1016cff4ff From 1016cff4ff43d8977bda01cc59867e75ad238836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= <shyouhei@r...> Date: Mon, 8 Jun 2020 14:26:49 +0900 Subject: 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. diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 11e03f8..65bebd3 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1799,15 +1799,14 @@ rb_equal_opt(VALUE obj1, VALUE obj2) https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1799 #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) https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1818 #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 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/