aboutsummaryrefslogtreecommitdiffstats
path: root/error.c
Commit message (Collapse)AuthorAgeFilesLines
* use "enum ruby_tag_type" and TAG_NONE.ko12017-06-231-3/+3
| | | | | | | | | | | | | | | Return value of EXEC_TAG() is saved by "int state". Instead of "int", use "enum ruby_tag_type". First EXEC_TAG() value should be 0, so that define TAG_NONE (= 0) and use it. Some code used "status" instead of "state". To make them clear, rename them to state. We can change variable name from "state" to "tag_state", but this ticket doesn't contain it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rb_execution_context_t: move stack, stack_size and cfp from rb_thread_tnormal2017-05-091-1/+2
| | | | | | | | | | The goal is to reduce rb_context_t and rb_fiber_t size by removing the need to store the entire rb_thread_t in there. [ruby-core:81045] Work-in-progress: soon, we will move more fields here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Send the backtrace of the circular require warning as a single String to ↵eregon2017-04-271-0/+8
| | | | | | | | | | | Warning.warn * load.c: send as a single string. * error.c: expose the string formatted by rb_warning as rb_warning_string(). * test/ruby/test_exception.rb: update tests. [ruby-core:80850] [Bug #13505] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: send as a single stringnobu2017-04-261-2/+19
| | | | | | | | * error.c (rb_warn_m): send the arguments as a single string concatenated with a newline, so it can be filtered easily. [ruby-core:80875] [Feature #12944] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: improve docsstomar2017-04-261-8/+7
| | | | | | | | * error.c: [DOC] fix rdoc formatting (make sure `Warning.warn' is displayed verbatim; rdoc would render it as a link named `#warn'), use capitalized "Ruby", fix a typo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: splat warn argumentsnobu2017-04-261-12/+2
| | | | | | | | * error.c (rb_warn_m): print array arguments with splatting. it is often used with `caller`. [ruby-core:80849] [Feature #12944] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Document the Warning module and warn methoderegon2017-04-251-0/+25
| | | | | | | * error.c (Warning): add documentation. [Feature #13504] Author: Jeremy Evans <code@jeremyevans.net> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* load.c: backtrace of circular requirenobu2017-04-251-1/+7
| | | | | | | * load.c (load_lock): print backtrace of circular require via `Warning.warn` [ruby-core:80850] [Bug #13505] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: check argc to rb_funcallnobu2017-04-151-1/+1
| | | | | | | * include/ruby/ruby.h (rb_funcall): check if argc matches the number of variadic arguments, and replace with rb_funcallv. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: err at glob failurenobu2017-03-271-2/+0
| | | | | | | | | | | | | * dir.c (glob_helper): raise a SystemCallError exception when opendir() failed, except for ENOENT, ENOTDIR, and EACCES. this behavior predates 1.0; the comments in glob.c claimed that glob() returned -1 on error but actualy the pointer to a global variable, then dir_glob() did check only -1 as the comments, and ignored actual errors. [ruby-core:80226] [Bug #13276] dir.c: ruby_glob_funcs_t git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: warning functionsnobu2017-03-271-0/+70
| | | | | | | | | * error.c: define warning functions in all combinations of * no errno, system errno, argument * without/with encoding * enabled/disabled by default git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: refactor warning messagesnobu2017-03-271-66/+48
| | | | | | | | | | * error.c (with_warning_string): extract building warning message string from variadic arguments. * error.c (syserr_warning): write warning message with the system error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: remove deprecated internal featuresnobu2017-02-211-18/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* DEPRECATED_INTERNAL_FEATUREnobu2017-02-171-4/+4
| | | | | | | | | * error.c (ruby_deprecated_internal_feature): renamed, to explicitly represent deprecation. * internal.h (DEPRECATED_INTERNAL_FEATURE): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: fixed doc [ci skip]nobu2017-01-231-3/+1
| | | | | | | | | * error.c (exc_message): fixed doc regarding the presence of to_str. [Fix GH-1517] Author: Marc Gauthier <marcg.gauthier@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: print default RSnobu2017-01-201-1/+4
| | | | | | | * error.c (rb_warn_m): print the default RS instead of an empty string with a newline. [Feature #12944] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Change Kernel#warn to call Warning.warnnobu2017-01-191-4/+15
| | | | | | | | | | | | | | | | | | This allows Warning.warn to filter/process warning messages generated by Kernel#warn. Currently, Warning.warn can only handle messages generated by the rb_warn/rb_warning C functions. The Kernel#warn API is different than the Warning.warn API, this tries to get similar behavior, but there are probably corner cases where the behavior is different. This makes str_end_with_asciichar in io.c no longer static so it can be called from error.c. [Feature #12944] Author: Jeremy Evans <code@jeremyevans.net> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: movednobu2017-01-131-2/+14
| | | | | | | * error.c (preface_dump, postscript_dump): CrashReporter directory was used before Mac OS X 10.6. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: movednobu2017-01-131-1/+70
| | | | | | | | * error.c (preface_dump, postscript_dump): moved from rb_vm_bugreport to place the last important message at the very last after [NOTE]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: redefined backtracenobu2016-11-131-10/+13
| | | | | | | | | | * error.c (rb_get_backtrace): honor redefined Exception#backtrace method. [ruby-core:78097] [Bug #12925] * eval.c (setup_exception): rescue exceptions during backtrace setup. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: rb_get_backtracenobu2016-11-131-0/+16
| | | | | | | * error.c (rb_get_backtrace): move from eval_error.c to call exc_backtrace directly. [ruby-core:78097] [Bug #12925] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [DOC] replace Fixnum with Integer [ci skip]nobu2016-10-261-1/+1
| | | | | | * numeric.c: [DOC] update document for Integer class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: check argument of Warning.warnnobu2016-09-271-0/+2
| | | | | | | * error.c (rb_warning_s_warn): the argument must be an ASCII-compatible string. [ruby-core:77430] [Bug #12793] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c: This makes all warnings raised call Warning.warn, whichshyouhei2016-09-271-8/+29
| | | | | | | | | | by default does the same thing it does currently (rb_write_error_str). You can override Warning.warn to change the behavior. [ruby-core:75016] [Feature #12299] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* replace fixnum by integer in documents.akr2016-09-081-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: fix newline in syntax errornobu2016-08-121-3/+3
| | | | | | | | * error.c (rb_syntax_error_append): fix newline in syntax error message to the beginning, not after file name and line number. [Feature #11951] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* internal.h: inline Check_Typenobu2016-07-231-15/+41
| | | | | | * internal.h (Check_Type): inline check for the object type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [Feature #12005] Unify Fixnum and Bignum into Integerakr2016-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [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
* 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