summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-10-19 17:08:25 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-10-19 17:08:25 +0900
commitec021e469d227d3f4e9c95ebb8c52b4a2526870a (patch)
treee43f78267f0b9dc6cc3228da23433406f67f10fc /vm_insnhelper.c
parent1d9e12925594be3d06230dc05e8b015f2928b491 (diff)
Get rid of type-punning cast
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 6c2ba1513d..f05e5e1fc7 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1084,14 +1084,16 @@ static bool
iv_index_tbl_lookup(struct st_table *iv_index_tbl, ID id, struct rb_iv_index_tbl_entry **ent)
{
int found;
+ st_data_t ent_data;
if (iv_index_tbl == NULL) return false;
RB_VM_LOCK_ENTER();
{
- found = st_lookup(iv_index_tbl, (st_data_t)id, (st_data_t *)ent);
+ found = st_lookup(iv_index_tbl, (st_data_t)id, &ent_data);
}
RB_VM_LOCK_LEAVE();
+ if (found) *ent = (struct rb_iv_index_tbl_entry *)ent_data;
return found ? true : false;
}