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

ruby-changes:65226

From: nagachika <ko1@a...>
Date: Thu, 11 Feb 2021 14:08:20 +0900 (JST)
Subject: [ruby-changes:65226] f49355a720 (ruby_2_7): merge revision(s) 555bd83a8e8b1e859f698089cbbd9ad938159a0e: [Backport #17192]

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

From f49355a720afe492ea49809e469dce36a9ea961a Mon Sep 17 00:00:00 2001
From: nagachika <nagachika@r...>
Date: Thu, 11 Feb 2021 13:29:25 +0900
Subject: merge revision(s) 555bd83a8e8b1e859f698089cbbd9ad938159a0e: [Backport
 #17192]

	Raise when loading unprovided builtin function [Bug #17192]

	---
	 compile.c              |  7 +++----
	 test/ruby/test_iseq.rb | 15 +++++++++++++++
	 2 files changed, 18 insertions(+), 4 deletions(-)
---
 compile.c | 7 +++----
 version.h | 2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/compile.c b/compile.c
index c05a4a0..e2c24a1 100644
--- a/compile.c
+++ b/compile.c
@@ -9847,14 +9847,13 @@ ibf_load_builtin(const struct ibf_load *load, ibf_offset_t *offset) https://github.com/ruby/ruby/blob/trunk/compile.c#L9847
     const char *name = (char *)ibf_load_ptr(load, offset, len);
 
     if (0) {
-        for (int i=0; i<len; i++) fprintf(stderr, "%c", name[i]);
-        fprintf(stderr, "!!\n");
+        fprintf(stderr, "%.*s!!\n", len, name);
     }
 
     const struct rb_builtin_function *table = GET_VM()->builtin_function_table;
-    if (table == NULL) rb_bug("%s: table is not provided.", RUBY_FUNCTION_NAME_STRING);
+    if (table == NULL) rb_raise(rb_eArgError, "builtin function table is not provided");
     if (strncmp(table[i].name, name, len) != 0) {
-        rb_bug("%s: index (%d) mismatch (expect %s but %s).", RUBY_FUNCTION_NAME_STRING, i, name, table[i].name);
+        rb_raise(rb_eArgError, "builtin function index (%d) mismatch (expect %s but %s)", i, name, table[i].name);
     }
     // fprintf(stderr, "load-builtin: name:%s(%d)\n", table[i].name, table[i].argc);
 
diff --git a/version.h b/version.h
index 798bfeb..846be55 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 3
 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 150
+#define RUBY_PATCHLEVEL 151
 
 #define RUBY_RELEASE_YEAR 2021
 #define RUBY_RELEASE_MONTH 2
-- 
cgit v1.1


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

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