[前][次][番号順一覧][スレッド一覧]

ruby-changes:69077

From: John <ko1@a...>
Date: Thu, 21 Oct 2021 08:20:46 +0900 (JST)
Subject: [ruby-changes:69077] 42574768a1 (master): Fix ctx_clear_local_types

https://git.ruby-lang.org/ruby.git/commit/?id=42574768a1

From 42574768a153bceb303fa74d50eb50a024f98173 Mon Sep 17 00:00:00 2001
From: John Hawthorn <john@h...>
Date: Tue, 27 Jul 2021 23:38:24 -0700
Subject: Fix ctx_clear_local_types

---
 yjit_core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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) https://github.com/ruby/ruby/blob/trunk/yjit_core.c#L259
 {
     // 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));
 }
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]