diff options
author | Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> | 2021-01-19 14:17:51 -0500 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:27 -0400 |
commit | dde69ab5c63a01c20c9bc19b7a11d9c64f6dab2a (patch) | |
tree | 4b7200162f8540e7afc2f0a491847426c892de8c /ujit_core.c | |
parent | 136bf983beaf46bebd13026890eda8dafff279ce (diff) |
Fix ujit block hash table bug
Diffstat (limited to 'ujit_core.c')
-rw-r--r-- | ujit_core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ujit_core.c b/ujit_core.c index 3211643f80..6f51440b86 100644 --- a/ujit_core.c +++ b/ujit_core.c @@ -115,6 +115,7 @@ block_t* gen_block_version(blockid_t blockid, const ctx_t* start_ctx) // Keep track of the new block version st_insert(version_tbl, (st_data_t)&block->blockid, (st_data_t)block); + RUBY_ASSERT(find_block_version(blockid, start_ctx) != NULL); // For each successor block to compile for (;;) { @@ -482,7 +483,7 @@ int blockid_cmp(st_data_t arg0, st_data_t arg1) { const blockid_t *block0 = (const blockid_t*)arg0; const blockid_t *block1 = (const blockid_t*)arg1; - return (block0->iseq == block1->iseq) && (block0->idx == block1->idx); + return (block0->iseq != block1->iseq) || (block0->idx != block1->idx); } st_index_t blockid_hash(st_data_t arg) |