aboutsummaryrefslogtreecommitdiffstats
path: root/iseq.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-06-29 16:31:35 -0400
committerPeter Zhu <peter@peterzhu.ca>2023-06-30 09:13:31 -0400
commit58386814a7c7275f66ffa111175fca2fe307a1b5 (patch)
tree56bfd1daec3a6d83dfda64b569de1b9fbbb4d23c /iseq.c
parent37a893d12915b8860f6880d6a0c2859e096ab4ff (diff)
downloadruby-58386814a7c7275f66ffa111175fca2fe307a1b5.tar.gz
Don't check for null pointer in calls to free
According to the C99 specification section 7.20.3.2 paragraph 2: > If ptr is a null pointer, no action occurs. So we do not need to check that the pointer is a null pointer.
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/iseq.c b/iseq.c
index 0878ba9f84..c1dd3efc4c 100644
--- a/iseq.c
+++ b/iseq.c
@@ -170,9 +170,9 @@ rb_iseq_free(const rb_iseq_t *iseq)
#endif
ruby_xfree((void *)body->iseq_encoded);
ruby_xfree((void *)body->insns_info.body);
- if (body->insns_info.positions) ruby_xfree((void *)body->insns_info.positions);
+ ruby_xfree((void *)body->insns_info.positions);
#if VM_INSN_INFO_TABLE_IMPL == 2
- if (body->insns_info.succ_index_table) ruby_xfree(body->insns_info.succ_index_table);
+ ruby_xfree(body->insns_info.succ_index_table);
#endif
if (LIKELY(body->local_table != rb_iseq_shared_exc_local_tbl))
ruby_xfree((void *)body->local_table);