Project

General

Profile

Bug #18062 » 0001-Get-rid-of-type-punning-pointer-cast.patch

nobu (Nobuyoshi Nakada), 08/06/2021 12:10 PM

View differences:

vm_insnhelper.c
const ID mid = vm_ci_mid(ci);
struct rb_id_table *cc_tbl = RCLASS_CC_TBL(klass);
struct rb_class_cc_entries *ccs = NULL;
VALUE ccs_data;
if (cc_tbl) {
if (rb_id_table_lookup(cc_tbl, mid, (VALUE *)&ccs)) {
if (rb_id_table_lookup(cc_tbl, mid, &ccs_data)) {
ccs = (struct rb_class_cc_entries *)ccs_data;
const int ccs_len = ccs->len;
VM_ASSERT(vm_ccs_verify(ccs, mid, klass));
......
if (ccs == NULL) {
VM_ASSERT(cc_tbl != NULL);
if (LIKELY(rb_id_table_lookup(cc_tbl, mid, (VALUE*)&ccs))) {
if (LIKELY(rb_id_table_lookup(cc_tbl, mid, &ccs_data))) {
// rb_callable_method_entry() prepares ccs.
ccs = (struct rb_class_cc_entries *)ccs_data;
}
else {
// TODO: required?
(1-1/4)