aboutsummaryrefslogtreecommitdiffstats
path: root/error.c
Commit message (Collapse)AuthorAgeFilesLines
* internal.h: ONLY_FOR_INTERNAL_USEnobu2016-04-271-0/+10
| | | | | | | | * 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
* error.c: SyntaxError#initializenobu2016-04-201-0/+20
| | | | | | | | | * 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
* refactor syntax errornobu2016-04-201-5/+11
| | | | | | | | | | | * 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
* refactor parser errornobu2016-04-191-20/+15
| | | | | | | | | | * 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
* appending compile error without rb_errinfonobu2016-04-191-6/+13
| | | | | | | | | * 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
* error.c: warn_vsprintfnobu2016-04-181-18/+13
| | | | | | * 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
* error.c: compile_vsprintfnobu2016-04-181-3/+3
| | | | | | | * 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
* error.c: remove unused functionnobu2016-04-171-8/+0
| | | | | | | * 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
* remove rb_thread_t::base_blocknobu2016-03-281-8/+0
| | | | | | | | | * 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
* SyntaxError message at iseq compilenobu2016-03-191-51/+16
| | | | | | | | | | | | * 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
* NoMethodError#private_call?nobu2016-02-281-0/+11
| | | | | | | | | | | | * 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
* error.c: fix doc [ci skip]nobu2016-02-121-2/+2
| | | | | | | | * 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
* RUBY_ASSERTnobu2016-01-221-0/+13
| | | | | | | * 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
* * error.c: [DOC] fix Exception#backtrace_locations indent. [ci skip]sho-h2016-01-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert deprecated functionsnobu2015-12-241-4/+0
| | | | | | | * 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
* deprecate exposed internal functionsnobu2015-12-241-0/+4
| | | | | | | | | * 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
* preserve source file name encodingnobu2015-12-241-0/+22
| | | | | | | | * 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
* io.c: encoding in warningsnobu2015-12-131-2/+0
| | | | | | | * 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
* * *.c (*_memsize): do not check ptr.ko12015-12-091-1/+1
| | | | | | | | | | 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
* make local symbols staticnobu2015-12-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: name_err_local_variablesnobu2015-12-081-1/+39
| | | | | | | | * 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
* * compile.c (iseq_compile_each): add debug information to NODE_STRko12015-11-201-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* use rb_source_loc and rb_source_locationnobu2015-10-311-6/+4
| | | | | | | | | * 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
* error.c: receiver in NameErrornobu2015-10-281-1/+8
| | | | | | | | * 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
* NameError#receiver of uninitialized constantnobu2015-10-281-1/+1
| | | | | | | | | * 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
* error.c: rb_name_err_newnobu2015-10-281-0/+10
| | | | | | | * 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
* id.def: internal IDsnobu2015-10-271-3/+2
| | | | | | * 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
* error.c: suppress warningsnobu2015-10-271-2/+6
| | | | | | | | * 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
* update document [ci skip]nobu2015-10-251-1/+1
| | | | | | | | | * 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
* * ruby.c: introduce --enable-frozen-string-literal-debug option.ko12015-10-231-2/+10
| | | | | | | | | | | | | | | | | | | | | 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
* error.c: use fake stringnobu2015-10-231-5/+8
| | | | | | | * 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
* error.c: separate class namesnobu2015-10-231-15/+18
| | | | | | | | | * 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
* preserve encodings in error messagesnobu2015-09-281-10/+29
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: remove singleton methodnobu2015-06-251-2/+1
| | | | | | | | | | * 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
* error.c: ArgumentError if no receivernobu2015-06-231-1/+4
| | | | | | | * 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
* error.c: index numbersnobu2015-06-231-8/+13
| | | | | | | * 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
* error.c: NameError#receivernobu2015-06-181-0/+17
| | | | | | | * 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
* wrapper object before allocnobu2015-05-161-5/+2
| | | | | | | | | | * 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
* vm_dump.c: statement for crash report lognobu2015-05-121-3/+0
| | | | | | | * 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
* error.c: update builtin_typesnobu2015-03-301-3/+2
| | | | | | | * 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
* eval.c: static IDsnobu2015-02-231-2/+3
| | | | | | | * 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
* error.c: predefined IDsnobu2015-02-231-3/+3
| | | | | | | | * 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
* error.c: use static IDsnobu2015-02-221-9/+9
| | | | | | | * 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
* use rb_funcallvnobu2015-02-161-2/+2
| | | | | | | * 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
* error.c: use static IDsnobu2015-02-161-29/+33
| | | | | | * 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
* error.c: rb_sys_enc_warningnobu2015-02-061-0/+52
| | | | | | | * 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
* error.c: warning_stringnobu2015-02-061-10/+15
| | | | | | | * 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
* error.c: fix r49479nobu2015-02-031-1/+1
| | | | | | * 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
* remove duplication in warningnobu2015-02-031-1/+0
| | | | | | | * 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
* ruby.h: parent in rb_data_type_tnobu2014-12-241-4/+6
| | | | | | | * ruby.h (rb_data_type_t): revert r48647 and revise parent member. [ruby-core:66969] [Bug #10621] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e