summaryrefslogtreecommitdiff
path: root/yjit_core.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2021-07-27 23:38:24 -0700
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:38 -0400
commit42574768a153bceb303fa74d50eb50a024f98173 (patch)
tree45ba559588ece5a71b5ca522e022b6ac6b8de2db /yjit_core.c
parent250b97da9be7d8d62be8055249497d9a93d83302 (diff)
Fix ctx_clear_local_types
Diffstat (limited to 'yjit_core.c')
-rw-r--r--yjit_core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/yjit_core.c b/yjit_core.c
index f1a57a01ae..07da8f6723 100644
--- a/yjit_core.c
+++ b/yjit_core.c
@@ -259,13 +259,14 @@ void ctx_clear_local_types(ctx_t* ctx)
{
// When clearing local types we must detach any stack mappings to those
// locals. Even if local values may have changed, stack values will not.
- for (int i = 0; i < ctx->stack_size && i < MAX_LOCAL_TYPES; i++) {
+ for (int i = 0; i < MAX_TEMP_TYPES; i++) {
temp_mapping_t *mapping = &ctx->temp_mapping[i];
if (mapping->kind == TEMP_LOCAL) {
RUBY_ASSERT(mapping->idx < MAX_LOCAL_TYPES);
ctx->temp_types[i] = ctx->local_types[mapping->idx];
*mapping = MAP_STACK;
}
+ RUBY_ASSERT(mapping->kind == TEMP_STACK || mapping->kind == TEMP_SELF);
}
memset(&ctx->local_types, 0, sizeof(ctx->local_types));
}