aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2021-02-11 13:29:25 +0900
committernagachika <nagachika@ruby-lang.org>2021-02-11 13:51:09 +0900
commitf49355a720afe492ea49809e469dce36a9ea961a (patch)
tree20277e26569a059fb2d2b545f9c65c75f656d9e6 /compile.c
parentc271c7a225c6175f56f00b785e3034cb4a2b7658 (diff)
downloadruby-f49355a720afe492ea49809e469dce36a9ea961a.tar.gz
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(-)
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/compile.c b/compile.c
index c05a4a0804..e2c24a119b 100644
--- a/compile.c
+++ b/compile.c
@@ -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);