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

ruby-changes:62270

From: nagachika <ko1@a...>
Date: Sun, 19 Jul 2020 11:56:47 +0900 (JST)
Subject: [ruby-changes:62270] f43b8c4f73 (ruby_2_7): merge revision(s) 0ba27259d390e902139c0e2e94b9d18ef227748e: [Backport #16940]

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

From f43b8c4f7304ebea91cd01d5606e13273d0fd755 Mon Sep 17 00:00:00 2001
From: nagachika <nagachika@r...>
Date: Sun, 19 Jul 2020 11:56:32 +0900
Subject: merge revision(s) 0ba27259d390e902139c0e2e94b9d18ef227748e: [Backport
 #16940]

	Fix crashes in the peephole optimizer on OpenBSD/sparc64

	These crashes are due to alignment issues, casting ADJUST to INSN
	and then accessing after the end of the ADJUST.  These patches
	come from Stefan Sperling <stsp@a...>, who reported the
	issue.

diff --git a/compile.c b/compile.c
index 7043ba9..15b7076 100644
--- a/compile.c
+++ b/compile.c
@@ -2719,7 +2719,8 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal https://github.com/ruby/ruby/blob/trunk/compile.c#L2719
 	    ELEM_REMOVE(&iobj->link);
 	    return COMPILE_OK;
 	}
-	else if (iobj != diobj && IS_INSN_ID(diobj, jump) &&
+        else if (iobj != diobj && IS_INSN(&diobj->link) &&
+                 IS_INSN_ID(diobj, jump) &&
 		 OPERAND_AT(iobj, 0) != OPERAND_AT(diobj, 0)) {
 	    /*
 	     *  useless jump elimination:
@@ -2897,7 +2898,7 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal https://github.com/ruby/ruby/blob/trunk/compile.c#L2898
             }
 
             for (;;) {
-                if (IS_INSN_ID(nobj, jump)) {
+                if (IS_INSN(&nobj->link) && IS_INSN_ID(nobj, jump)) {
                     replace_destination(iobj, nobj);
                 }
                 else if (prev_dup && IS_INSN_ID(nobj, dup) &&
diff --git a/version.h b/version.h
index eb93496..ad01425 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L2
 # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
 #define RUBY_VERSION_TEENY 1
 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 95
+#define RUBY_PATCHLEVEL 96
 
 #define RUBY_RELEASE_YEAR 2020
 #define RUBY_RELEASE_MONTH 7
-- 
cgit v0.10.2


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

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