summaryrefslogtreecommitdiff
path: root/error.c
AgeCommit message (Collapse)Author
2016-05-17[Feature #12005] Unify Fixnum and Bignum into Integerakr
* [Feature #12005] Unify Fixnum and Bignum into Integer * include/ruby/ruby.h (rb_class_of): Return rb_cInteger for fixnums. * insns.def (INTEGER_REDEFINED_OP_FLAG): Unified from FIXNUM_REDEFINED_OP_FLAG and BIGNUM_REDEFINED_OP_FLAG. * vm_core.h: Ditto. * vm_insnhelper.c (opt_eq_func): Use INTEGER_REDEFINED_OP_FLAG instead of FIXNUM_REDEFINED_OP_FLAG. * vm.c (vm_redefinition_check_flag): Use rb_cInteger instead of rb_cFixnum and rb_cBignum. (C): Use Integer instead of Fixnum and Bignum. * numeric.c (fix_succ): Removed. (Init_Numeric): Define Fixnum as Integer. * bignum.c (bignew): Use rb_cInteger instead of Rb_cBignum. (rb_int_coerce): replaced from rb_big_coerce and return fixnums as-is. (Init_Bignum): Define Bignum as Integer. Don't define ===. * error.c (builtin_class_name): Return "Integer" for fixnums. * sprintf.c (ruby__sfvextra): Use rb_cInteger instead of rb_cFixnum. * ext/-test-/testutil: New directory to test. Currently it provides utilities for fixnum and bignum. * ext/json/generator/generator.c: Define mInteger_to_json. * lib/mathn.rb (Fixnum#/): Redefinition removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-27internal.h: ONLY_FOR_INTERNAL_USEnobu
* error.c (ruby_only_for_internal_use): raise fatal error when deprecated function only for internal use is called, not just a warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-20error.c: SyntaxError#initializenobu
* error.c (syntax_error_initialize): move the default message, "compile error", from parse.y. the default parameter should belong to the class definition. * parse.y (yycompile0): use the default parameter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-20refactor syntax errornobu
* compile.c (append_compile_error): use rb_syntax_error_append. * error.c (rb_syntax_error_append): append messages into a SyntaxError exception instance. * parse.y (yycompile0): make new SyntaxError instance in main mode, otherwize error_buffer should be a SyntaxError if error has occurred. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-19refactor parser errornobu
* error.c (err_vcatf): rename, and separate appending message from creating a string buffer. * error.c (rb_syntax_error_append): merge rb_error_vsprintf and rb_compile_err_append. * parse.y (parser_compile_error): use rb_syntax_error_append. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-19appending compile error without rb_errinfonobu
* compile.c (append_compile_error, compile_bug): pass iseq and get error info and file from it, not by the thread error info. * error.c (rb_report_bug_valist): take va_list instead of variadic arguments, and just report the bug but not abort. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-18error.c: warn_vsprintfnobu
* error.c (warn_vsprintf, warning_string): share common code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-18error.c: compile_vsprintfnobu
* error.c (compile_vsprintf): rename compile_snprintf, following the argument changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-17error.c: remove unused functionnobu
* error.c (rb_compile_bug): remove unused function, which has never been exposed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-28remove rb_thread_t::base_blocknobu
* error.c (rb_compile_err_append): rb_thread_t::base_block is no longer used. * iseq.c (rb_iseq_compile_with_option): ditto, no protection is needed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-19SyntaxError message at iseq compilenobu
* iseq.c (rb_iseq_compile_with_option): make the parser in mild error. * load.c (rb_load_internal0): ditto. * parse.y (yycompile0): return the error message within the error to be raised. [Feature #11951] * parse.y (parser_compile_error): accumulate error messages in the error_buffer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-28NoMethodError#private_call?nobu
* error.c (nometh_err_initialize): add private_call? parameter. * error.c (nometh_err_private_call_p): add private_call? method, to tell if the exception raised in private form FCALL or VCALL. [Feature #12043] * vm_eval.c (make_no_method_exception): append private_call? argument. * vm_insnhelper.c (ci_missing_reason): copy FCALL flag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-12error.c: fix doc [ci skip]nobu
* error.c (name_err_initialize, nometh_err_initialize): [DOC] fix argument positions. optional parameters except for the message are placed at the last. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-22RUBY_ASSERTnobu
* error.c (rb_assert_failure): assertion with stack dump. * ruby_assert.h (RUBY_ASSERT): new header for the assertion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-19* error.c: [DOC] fix Exception#backtrace_locations indent. [ci skip]sho-h
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-24revert deprecated functionsnobu
* error.c (rb_compile_error_with_enc, rb_compile_error), (rb_compile_bug): revert deprecate internal functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-24deprecate exposed internal functionsnobu
* error.c (rb_compile_error_with_enc, rb_compile_error), (rb_compile_bug): deprecate internal functions. * parse.y (parser_yyerror): construct exception message with source code and carret. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-24preserve source file name encodingnobu
* compile.c (append_compile_error), parse.y (compile_error): preserve encoding of source file name in exceptions. * error.c (rb_compile_error_str, rb_compile_bug_str): add. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-13io.c: encoding in warningsnobu
* io.c (parse_mode_enc): preserve encoding of mode string in warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-09* *.c (*_memsize): do not check ptr.ko1
NULL checking is finished Before call of memsize functions. See r52979. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08make local symbols staticnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08error.c: name_err_local_variablesnobu
* error.c (name_err_local_variables): new method NameError#local_variables for internal use only. [Feature #11777] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-20* compile.c (iseq_compile_each): add debug information to NODE_STRko1
strings as default. [Feature #11725] * insns.def (freezestring): add new instruction to support adding debug information for dynamically constracted strings. * compile.c (iseq_compile_each): support adding debug information for NODE_DSTR with freezestring instruction. * error.c (rb_error_frozen): change the debug information ID name id_debug_created_info and this field should have a 2 element array containing path and line information. * defs/id.def: ditto. * test/ruby/test_rubyoptions.rb: catch up this fix. * test/ruby/test_iseq.rb: now frozen strings are not same. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-31use rb_source_loc and rb_source_locationnobu
* error.c, eval.c, eval_error.c, gc.c, variable.c, vm.c, vm_eval.c, vm_trace.c: use rb_source_loc/rb_source_location instead of combination of rb_sourcefile/rb_sourcefilename and rb_sourceline. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-28error.c: receiver in NameErrornobu
* error.c (rb_name_err_new): store the receiver directly. * error.c (name_err_receiver): return directly stored receiver. [Feature #10881] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-28NameError#receiver of uninitialized constantnobu
* error.c (name_err_mesg_to_str): quote the name if unprintable. * object.c (check_setter_id): use rb_check_id to convert names. * variable.c (uninitialized_constant): use NameError::message to keep the receiver of uninitialized constant. [Feature #10881] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-28error.c: rb_name_err_newnobu
* error.c (rb_name_err_new): new function to create NameError exception instance. [Feature #10881] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-27id.def: internal IDsnobu
* defs/id.def: move internal IDs for frozen-string-literal-debug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-27error.c: suppress warningsnobu
* error.c (rb_error_frozen_object): use rb_attr_get instead of rb_ivar_get to get rid of warnings for string objects created when frozen-string-literal-debug is disabled. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-25update document [ci skip]nobu
* error.c (ArgumentError): [DOC] update document following [Feature #9025] * proc.c (proc_call, proc_curry): [DOC] ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-23* ruby.c: introduce --enable-frozen-string-literal-debug option.ko1
If this option is enabled, the modify error will be: can't modify frozen String (RuntimeError) => can't modify frozen String, created at test.rb:3 (RuntimeError) * iseq.h: add compile option frozen_string_literal_debug. * compile.c: catch up this fix. * error.c (rb_error_frozen): ditto. * iseq.c (set_compile_option_from_hash): ditto. * test/ruby/test_rubyoptions.rb: add a test for this fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-23error.c: use fake stringnobu
* error.c (name_err_mesg_to_str): use fake string as rb_str_format does not require T_STRING to be cannonical VALUE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-23error.c: separate class namesnobu
* error.c (name_err_mesg_to_str): separate class names from the receiver description. * vm_eval.c (make_no_method_exception, raise_method_missing): add format specifiers for class names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-28preserve encodings in error messagesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-25error.c: remove singleton methodnobu
* error.c (rb_name_err_mesg_new): remove singleton method, and unused argument. * vm_eval.c (make_no_method_exception): call rb_name_err_mesg_new directly instead of constant lookup and method invocation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-23error.c: ArgumentError if no receivernobu
* error.c (name_err_receiver): raise ArgumentError if no receiver is available on this exception object. [Feature #10881] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-23error.c: index numbersnobu
* error.c (rb_name_err_mesg_new, name_err_mesg_to_str): name magic numbers of indexes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-18error.c: NameError#receivernobu
* error.c (name_err_receiver): add NameError#receiver method. [Feature #10881] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-16wrapper object before allocnobu
* error.c (rb_name_err_mesg_new): new wrapper object before allocate data area and get rid of potential memory leak. GC guards are no longer needed. * file.c (stat_new_0): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-12vm_dump.c: statement for crash report lognobu
* vm_dump.c (preface_dump): move the statement to include crash report log file from REPORTBUG_MSG in error.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-30error.c: update builtin_typesnobu
* error.c (builtin_types): update for r49932, insert T_IMEMO and move T_UNDEF. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-23eval.c: static IDsnobu
* eval.c (ruby_static_id_signo, ruby_static_id_status): add static IDs, signo and status. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-23error.c: predefined IDsnobu
* error.c (id_bt, id_bt_locations): use IDs predefined in id.h. * vm_args.c (raise_argument_error): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-22error.c: use static IDsnobu
* error.c: use rb_ivar_set with static IDs instead of rb_iv_set with strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-16use rb_funcallvnobu
* use rb_funcallv() for no arguments call instead of variadic rb_funcall(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-16error.c: use static IDsnobu
* error.c (Init_Exception): initialize static IDs first. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-06error.c: rb_sys_enc_warningnobu
* error.c (rb_sys_enc_warning): new function to show warning and error message with the encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-06error.c: warning_stringnobu
* error.c (warning_string): extract a method to create warning message string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-03error.c: fix r49479nobu
* error.c (rb_mod_sys_fail_str): copy the given format. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-03remove duplication in warningnobu
* dir.c (sys_warning_1): remove duplication in the message. * error.c (rb_mod_sys_fail_str): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e