Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a5b5fea

Browse files
committed
Only de-reference when we need to check the object type
1 parent 8c7be5f commit a5b5fea

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

iseq.c

+7-5
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ rb_iseq_free(const rb_iseq_t *iseq)
115115

116116
#if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
117117
static int
118-
rb_vm_insn_addr2insn2(const void *addr) /* cold path */
118+
rb_vm_insn_addr2insn2(const void *addr)
119119
{
120120
int insn;
121121
const void * const *table = rb_vm_get_insns_address_table();
@@ -145,15 +145,17 @@ iseq_extract_values(const VALUE *code, size_t pos, iseq_value_itr_t * func, void
145145

146146
for (op_no = 0; types[op_no]; op_no++) {
147147
char type = types[op_no];
148-
VALUE op = code[pos + op_no + 1];
149148
switch (type) {
150149
case TS_CDHASH:
151150
case TS_ISEQ:
152151
case TS_VALUE:
153-
if (!SPECIAL_CONST_P(op)) {
154-
func(data, op);
152+
{
153+
VALUE op = code[pos + op_no + 1];
154+
if (!SPECIAL_CONST_P(op)) {
155+
func(data, op);
156+
}
157+
break;
155158
}
156-
break;
157159
default:
158160
break;
159161
}

0 commit comments

Comments
 (0)