summaryrefslogtreecommitdiff
path: root/yjit_core.c
diff options
context:
space:
mode:
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));
}