aboutsummaryrefslogtreecommitdiffstats
path: root/eval_error.c
Commit message (Collapse)AuthorAgeFilesLines
* Use HAVE_BUILTIN___BUILTIN_CONSTANT_Pnaruse2016-05-121-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval_error.c: reuse threadptrnobu2016-04-231-6/+5
| | | | | | | * eval_error.c (error_print, error_handle): reuse same threadptr by passing as an argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval_error.c: trivial optimizationnobu2016-03-061-0/+9
| | | | | | | * eval_error.c (warn_print): optimize warn_print with a string literal, with rb_write_error2 instead of rb_write_error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval_error.c: constifynobu2016-02-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval_error.c: remove warn_printfnobu2016-02-251-20/+20
| | | | | | | | | * eval_error.c (warn_printf): remove. * eval_error.c (error_pos_str): return error position string, split from error_pos. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval_error.c: error position formatnobu2016-02-251-19/+5
| | | | | | | * eval_error.c (error_print): use same error position format when no backtrace too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval_error.c: colon in messagenobu2016-02-251-15/+15
| | | | | | | | | * eval_error.c (error_pos): include a clone after the position. * eval_error.c (error_print, error_handle): do not print a colon if the error position is unavailable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use `rb_method_visibility_t` instead of `int` in `rb_print_undef`yui-knk2016-01-031-1/+1
| | | | | | | | | | | * eval_error.c (rb_print_undef): Use `rb_method_visibility_t` instead of `int`. * eval_intern.h (rb_print_undef): ditto * proc.c (mnew_internal): ditto * vm_method.c (rb_export_method): ditto [Misc #11649] [ruby-core:71311] [fix GH-1078] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval_error.c: Fix a format of `NameError#message`nobu2015-10-311-1/+1
| | | | | | | | | * eval_error.c (undef_mesg_for): fix typo. Before this commit `ArgumentError: malformed format string - %$` was raised when `NameError#message` is called. [ruby-core:71282] [Bug #11640] [Fix GH-1077] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use rb_source_loc and rb_source_locationnobu2015-10-311-4/+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
* NameError#receiver of uninitialized constantnobu2015-10-281-27/+33
| | | | | | | | | * 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
* eval.c: check tag valuenobu2015-07-191-1/+4
| | | | | | * eval.c (rb_jump_tag): paranoiac check of tag value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.h: split rb_method_definition_t::flag to several flags.ko12015-06-031-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `flag' contains several categories of attributes and it makes us confusion (at least, I had confused). * rb_method_visibility_t (flags::visi) * NOEX_UNDEF -> METHOD_VISI_UNDEF = 0 * NOEX_PUBLIC -> METHOD_VISI_PUBLIC = 1 * NOEX_PRIVATE -> METHOD_VISI_PRIVATE = 2 * NOEX_PROTECTED -> METHOD_VISI_PROTECTED = 3 * NOEX_SAFE(flag)) -> safe (flags::safe, 2 bits) * NOEX_BASIC -> basic (flags::basic, 1 bit) * NOEX_MODFUNC -> rb_scope_visibility_t in CREF * NOEX_SUPER -> MISSING_SUPER (enum missing_reason) * NOEX_VCALL -> MISSING_VCALL (enum missing_reason) * NOEX_RESPONDS -> BOUND_RESPONDS (macro) Now, NOEX_NOREDEF is not supported (I'm not sure it is needed). Background: I did not know what "NOEX" stands for. I asked Matz (who made this name) and his answer was "Nothing". "At first, it meant NO EXport (private), but the original meaning was gone." This is why I remove the mysterious word "NOEX" from MRI. * vm_core.h: introduce `enum missing_reason' to represent method_missing (NoMethodError) reason. * eval_intern.h: introduce rb_scope_visibility_t to represent scope visibility. It has 3 method visibilities (public/private/protected) and `module_function`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c: static IDsnobu2015-02-231-2/+2
| | | | | | | * 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
* * eval_error.c (error_print): pos and len parameters of rb_str_substr()usa2015-01-101-1/+1
| | | | | | | | are counted by characters, not bytes. use rb_str_subseq() instead. [Bug #10727] [ruby-core:67473] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_error.c (error_print): respect the encoding of the message.usa2014-11-281-2/+2
| | | | | | | | * io.c (rb_write_error_str): use rb_w32_write_console() on Windows if stderr is a tty. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rb_id2str over rb_id2namenobu2014-11-251-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval_error.c: quote unprintablenobu2014-07-261-4/+4
| | | | | | | | | * eval_error.c (rb_print_undef, rb_print_undef_str): quote unprintable names. * eval_error.c (rb_print_inaccessible): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval_error.c: rb_print_inaccessiblenobu2014-07-261-2/+20
| | | | | | | * eval_error.c (rb_print_inaccessible): exract from mnew_from_me() in proc.c git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval_error.c: newline alwaysnobu2014-06-251-1/+1
| | | | | | | * eval_error.c (error_print): put a newline after an anonymous exception class name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval_error.c: investigate core dumpnobu2014-05-181-1/+2
| | | | | | | * eval_error.c (error_handle): show backtrace at SIGSEGV, to investigate core dump in CI. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_error.c (warn_printf): use rb_vsprintf instead so ruby specificcharliesome2013-06-241-7/+8
| | | | | | | | | | extensions like PRIsVALUE can be used in format strings * eval_error.c (error_print): use warn_print_str (alias for rb_write_error_str) to print a string value instead of using RSTRING_PTR and RSTRING_LEN manually * eval.c (setup_exception): use PRIsVALUE instead of %s and RSTRING_PTR git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_error.c (error_print): reduce RARRAY_AREF().nobu2013-06-111-2/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_error.c (error_print): keep that errat is non-shady object.tarui2013-06-101-3/+2
| | | | | | | and guard errat from GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval_error.c: use checking functionsnobu2013-06-101-3/+3
| | | | | | | * eval_error.c (error_print): use checking functions instead of catching exceptions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval_error.c: restore errinfonobu2013-06-101-0/+1
| | | | | | | | * eval_error.c (error_print): restore errinfo for the case new excecption raised while printing the message. [ruby-core:55365] [Bug #8501] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval_error.c: reduce setjmpnobu2013-06-101-7/+10
| | | | | | * eval_error.c (error_print): reduce calling setjmp. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* call rb_frame_callee() only oncenobu2013-05-241-2/+3
| | | | | | | | * eval_error.c (error_pos): no needs to call rb_frame_callee() twice. * safe.c (rb_secure, rb_insecure_operation): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * *.c, parse.y, insns.def: use RARRAY_AREF/ASET macroko12013-05-131-1/+1
| | | | | | | | instead of using RARRAY_PTR(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* internal.h: quote unprintablenobu2012-12-221-6/+6
| | | | | | | | | * internal.h (QUOTE, QUOTE_ID): quote unprintable chars in strings and IDs. [Bug #7574] [ruby-dev:46749] * string.c (rb_str_quote_unprintable): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_error.c (error_print), vm_eval.c (eval_string_with_cref),ko12012-10-231-6/+6
| | | | | | | | | vm_trace.c (rb_suppress_tracing): use TH_PUSH_TAG() instead of PUSH_TAG(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_method_defined_by): removed.ko12012-05-241-1/+3
| | | | | | | | | | nobu pointed out that rb_method_basic_definition_p() is enough for last commit. * error.c, eval_error.c: change for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c: add RubyVM::Backtrace object (btobj).ko12012-05-241-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backtrace information contains an array consists of location information for each frames by string. RubyVM::Backtrace object is lightweight backtrace information, which contains complete information to generate traditional style backtrace (an array of strings) with faster generation. If someone accesses to backtrace information via Exception#backtrace, then convert a RubyVM::Backtrace object to traditonal style backtrace. This change causes incompatibility on marshal dumpped binary of Exception. If you have any trouble on it, please tell us before Ruby 2.0 release. Note that RubyVM::Backtrace object should not expose Ruby level. * error.c, eval.c, vm_eval.c: ditto. * internal.h: ditto. * eval_error.c: fix to skip "set_backtrace" method invocation in creating an exception object if it call a normal set_backtrace method (defined by core). * test/ruby/test_settracefunc.rb: fix for above change. * vm_method.c (rb_method_defined_by): added. This function checks that the given object responds with the given method by the given cfunc. * benchmark/bm_vm2_raise1.rb, benchmark/bm_vm2_raise2.rb: add to measure exception creation speed. raise1 create exception objects from shallow stack frame. raise2 create exception objects from deep stack frame. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_error.c (error_print): use RB_TYPE_P instead of TYPE.nobu2012-04-131-1/+1
| | | | | | | | | * error.c (rb_check_backtrace): ditto. * error.c (name_err_mesg_to_str): compare immediate values directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * use RB_TYPE_P which is optimized for constant types, instead ofnobu2011-09-291-2/+2
| | | | | | comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_error.c (rb_print_undef_str): new function to raisenobu2011-07-261-0/+9
| | | | | | | | | | | NameError for undefined method. * load.c (rb_mod_autoload_p), object.c (rb_mod_const_get), variable.c (rb_f_untrace_var, set_const_visibility), vm_method.c (rb_mod_{remove,undef,alias}_method, set_method_visibility): remove inadvertent symbol creation. based on the first patch by Jeremy Evans at [ruby-core:38447]. [Feature #5089] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: declare more internal functions.akr2011-06-181-2/+0
| | | | | | | | | | | | | | * iseq.h (rb_method_get_iseq): declared. * compile.c, eval.c, eval_error.c, iseq.c, parse.y, proc.c, range.c, ruby.c, time.c, util.c, vm.c: don't declare internal functions. * eval.c, parse.y, thread_pthread.c: non-existing function declarations removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_error.c: parenthesize macro arguments.akr2010-12-121-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_error.c (error_print): clear raised_flag while error-printingwanabe2010-06-211-1/+5
| | | | | | | | | to avoid hang. [ruby-core:27608] * test/ruby/test_beginendblock.rb (test_endblock_raise): add test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_error.c (error_print): removed an extra argument.nobu2009-08-061-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_longjmp): reset raised flag before fatal error.nobu2009-08-051-3/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: rename functions which require a parameterko12009-06-081-2/+2
| | | | | | | | | | | | | | | "rb_thread_t *", the prefix to be rb_threadptr_ instead of rb_thread_. * thread.c (rb_thread_add_event_hook(), rb_thread_remove_event_hook): change the parameter type from rb_thread_t * to VALUE. * eval.c, eval_error.c, eval_intern.h, signal.c, vm_core.h, vm_eval.c: ditto. * include/ruby/intern.h: remove decl of rb_thread_signal_raise() and rb_thread_signal_exit(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_error.c (error_print): use volatile to suppress warnings.akr2009-02-281-3/+3
| | | | | | | | | | | | | | | * vm_eval.c (eval_string_with_cref): ditto. * thread.c (rb_exec_recursive): ditto. * eval_jump.c (rb_exec_end_proc): ditto. * eval.c (ruby_exec_node): ditto. (rb_longjmp): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* stripped trailing spaces.nobu2009-02-221-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppress warnings with -Wwrite-string.nobu2008-05-311-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_error.c (error_handle): SystemExit and SignalException throwsnobu2008-05-271-2/+4
| | | | | | | TAG_RAISE but not TAG_FATAL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_method.c: renamed from vm_method.c. "vm_method.c" is includedko12008-05-241-28/+6
| | | | | | | | | | | | | | | by "vm.c". * vm_eval.c: added. Some codes are moved from "eval.c" * common.mk: fix for above changes. * compile.c: make a vm_eval(0) * eval.c, eval_error.c, eval_intern.h, eval_jump.c, proc.c, vm.c, id.c, id.h, vm_core.h, vm_dump.c, vm_evalbody.c, vm_insnhelper.c, blockinlining.c: fix for above changes. and do some refactoring. this changes improve rb_yield() performance. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_error.c (error_handle): commit miss.nobu2008-02-281-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_error.c (error_print): append a newline to rest lines.nobu2008-02-141-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * common.mk, *.ci: renamed to *.c.ko12007-12-201-0/+291
* eval_laod.c: renamed to load.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e