summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2025-09-24 07:10:31 +0900
committerKoichi Sasada <ko1@atdot.net>2025-09-24 10:51:02 +0900
commit5b65e76a7d3aa5d6111fbf2b5bf371bdf478c352 (patch)
treeaae2cddeb5accd976f6a5ed9e97dfa863fe6697b
parent479cdab3378a9597b01a4a3febc382488484f21a (diff)
fix lvar_state dump size
`ibf_dump_write()` should consider the size of the element.
-rw-r--r--compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index fb269721f3..d3b9704cc9 100644
--- a/compile.c
+++ b/compile.c
@@ -13272,7 +13272,7 @@ ibf_dump_lvar_states(struct ibf_dump *dump, const rb_iseq_t *iseq)
const struct rb_iseq_constant_body *const body = ISEQ_BODY(iseq);
const int size = body->local_table_size;
IBF_W_ALIGN(enum lvar_state);
- return ibf_dump_write(dump, body->lvar_states, body->lvar_states ? size : 0);
+ return ibf_dump_write(dump, body->lvar_states, sizeof(enum lvar_state) * (body->lvar_states ? size : 0));
}
static enum lvar_state *