diff options
author | Nobuyoshi Nakada <[email protected]> | 2020-11-30 15:19:49 +0900 |
---|---|---|
committer | GitHub <[email protected]> | 2020-11-30 15:19:49 +0900 |
commit | 555bd83a8e8b1e859f698089cbbd9ad938159a0e (patch) | |
tree | fb9ff23ae3bf790d9af16d76dae9baba95e1dd93 /compile.c | |
parent | 73a337e21461469290005f169c05bc1791112d67 (diff) |
Raise when loading unprovided builtin function [Bug #17192]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3622
Merged-By: nobu <[email protected]>
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -10296,14 +10296,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); |