From 555bd83a8e8b1e859f698089cbbd9ad938159a0e Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 30 Nov 2020 15:19:49 +0900 Subject: Raise when loading unprovided builtin function [Bug #17192] --- compile.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'compile.c') diff --git a/compile.c b/compile.c index f6f5a1d848..0525c3ed87 100644 --- a/compile.c +++ b/compile.c @@ -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; ibuiltin_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); -- cgit v1.2.3