We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b53aff commit d50d595Copy full SHA for d50d595
ujit_core.c
@@ -167,9 +167,12 @@ add_block_version(blockid_t blockid, block_t* block)
167
// Ensure ujit_blocks is initialized for this iseq
168
if (rb_darray_size(body->ujit_blocks) == 0) {
169
// Initialize ujit_blocks to be as wide as body->iseq_encoded
170
- // TODO: add resize API for dary
171
- while ((unsigned)rb_darray_size(body->ujit_blocks) < body->iseq_size) {
172
- (void)rb_darray_append(&body->ujit_blocks, NULL);
+ int32_t casted = (int32_t)body->iseq_size;
+ if ((unsigned)casted != body->iseq_size) {
+ rb_bug("iseq too large");
173
+ }
174
+ if (!rb_darray_make(&body->ujit_blocks, casted)) {
175
+ rb_bug("allocation failed");
176
}
177
178
// First block compiled for this iseq
0 commit comments