ruby-changes:68854
From: Maxime <ko1@a...>
Date: Thu, 21 Oct 2021 08:12:48 +0900 (JST)
Subject: [ruby-changes:68854] 21c4dd037d (master): Fix bug unnecessarily causing version limit hit
https://git.ruby-lang.org/ruby.git/commit/?id=21c4dd037d From 21c4dd037d3f9c20dda281883b8d43fc2226d550 Mon Sep 17 00:00:00 2001 From: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@s...> Date: Fri, 5 Feb 2021 15:49:02 -0500 Subject: Fix bug unnecessarily causing version limit hit --- ujit_core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ujit_core.c b/ujit_core.c index 6daab05a46..d7b0d65e69 100644 --- a/ujit_core.c +++ b/ujit_core.c @@ -148,6 +148,9 @@ int ctx_diff(const ctx_t* src, const ctx_t* dst) https://github.com/ruby/ruby/blob/trunk/ujit_core.c#L148 // 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) https://github.com/ruby/ruby/blob/trunk/ujit_core.c#L269 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]; -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/