1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fix bug unnecessarily causing version limit hit

This commit is contained in:
Maxime Chevalier-Boisvert 2021-02-05 15:49:02 -05:00 committed by Alan Wu
parent d2ad0a1175
commit 21c4dd037d

View file

@ -148,6 +148,9 @@ int ctx_diff(const ctx_t* src, const ctx_t* dst)
// Add a block version to the map
static void add_block_version(blockid_t blockid, block_t* block)
{
// Function entry blocks must have stack size 0
RUBY_ASSERT(!(block->blockid.idx == 0 && block->ctx.stack_size > 0));
// If there exists a version for this block id
block_t* first_version = NULL;
st_lookup(version_tbl, (st_data_t)&blockid, (st_data_t*)&first_version);
@ -266,6 +269,9 @@ block_t* gen_block_version(blockid_t blockid, const ctx_t* start_ctx)
rb_bug("invalid target for last branch");
}
// Use the context from the branch
*ctx = last_branch->target_ctxs[0];
// Allocate a new block version object
block = calloc(1, sizeof(block_t));
block->blockid = last_branch->targets[0];