1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

merge revision(s) 555bd83a8e: [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(-)
This commit is contained in:
nagachika 2021-02-11 13:29:25 +09:00
parent c271c7a225
commit f49355a720
2 changed files with 4 additions and 5 deletions

View file

@ -9847,14 +9847,13 @@ ibf_load_builtin(const struct ibf_load *load, ibf_offset_t *offset)
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);

View file

@ -2,7 +2,7 @@
# 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