summaryrefslogtreecommitdiffstats
path: root/marshal.c
Commit message (Collapse)AuthorAgeFilesLines
* Add Float::INFINITY and Float::NAN.naruse2009-12-291-5/+3
| | | | | | | | | | | | | | | | | | | | * numeric.c (Init_Numeric): Add Float::INFINITY and Float::NAN. [ruby-dev:1657] [ruby-dev:4760] [ruby-list:7023] [ruby-list:46690] [ruby-core:26632] [ruby-talk:41352] [ruby-talk:203333] * include/ruby/defines.h (INFINITY): defined. * include/ruby/defines.h (NAN): defined. * include/ruby/util.h (ruby_div0): removed. * numeric.c (fix_pow): use INFINITY and NAN instead of ruby_div0(1.0). * marshal.c (r_object0): ditto. * bignum.c (big_fdiv): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@26197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (w_object): reverted r26007. [ruby-dev:39845]nobu2009-12-071-10/+1
| | | | | | | * test/test_delegate.rb (test_marshal): moved from test_marshal.rb. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@26042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (w_object): dump instance variables when usingnobu2009-12-051-1/+10
| | | | | | | | | marshal_dump. [ruby-core:24211] * variable.c (rb_ivar_count): added. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@26007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (mark_dump_arg): mark str. see also [ruby-dev:39735]wanabe2009-11-251-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (marshal_dump): use normal object as the buffer sonobu2009-11-211-2/+1
| | | | | | | that no hidden object is exposed to ruby-level. [ruby-dev:39744] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (w_object, r_object0): use RHASH_IFNONE but not ifnonenobu2009-11-111-4/+4
| | | | | | | directly. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add rdoc about objects can't Marshal#dump. [ruby-core:23314]naruse2009-11-041-0/+6
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typos.akr2009-11-031-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (w_symbol, r_symreal): fixed the order of symbol andnobu2009-10-201-2/+4
| | | | | | | | its encoding modifier, in order to make the dump readable from 1.8. [ruby-dev:39515] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (id2encidx): register encoding name.nobu2009-10-171-18/+29
| | | | | | | | (r_object0): register object before encoding name. [ruby-core:24882] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (r_object0): suppressed a warning.nobu2009-10-121-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (has_encoding): added for check the regexpnaruse2009-10-111-14/+39
| | | | | | | | is dumped by 1.8 or 1.9. * marshal.c (r_object0): use has_encoding. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (marshal_dump, marshal_load): prevent from GC.nobu2009-10-101-2/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (mark_dump_arg, mark_load_arg): ignore already cleanednobu2009-10-071-2/+6
| | | | | | | | | data. [ruby-core:25969] * marshal.c (clear_dump_arg, clear_load_arg): clear freed fields. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (struct {dump,load}_arg): manage with dfree, insteadnobu2009-10-041-76/+100
| | | | | | | | of using local variable which may be moved by context switch. [ruby-dev:39425] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (r_object0): entry regexp object before its encodingnobu2009-09-181-4/+6
| | | | | | | name. [ruby-core:25625] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (must_not_be_anonymous): fixed silly miss.nobu2009-08-091-3/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (class2path, w_unique, w_extended, w_class, w_uclass):nobu2009-08-091-33/+39
| | | | | | | | | | | | | deal with non-ascii class path. [ruby-core:24790] * marshal.c (r_unique, path2class, path2module, obj_alloc_by_path), (r_object0): ditto. * variable.c (rb_path_to_class): new encoding-aware function to get a class from its name. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (w_symbol r_symlink, r_symbol, r_object0): fix fornobu2009-08-071-17/+66
| | | | | | | | non-ascii symbols. loading such symbols can cause segfaults in older versions. [ruby-core:24788] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppressed shorten-64-to-32 warnings.nobu2009-07-181-18/+18
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (r_object0): should return real object.naruse2009-07-131-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (r_object0): should not shadow outer variable not tonobu2009-07-131-1/+1
| | | | | | | return Qnil always. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (r_object0): copy instance variables to new regexp.naruse2009-07-131-2/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (r_object0): set encoding only if the encoding is not US-ASCII.naruse2009-07-101-1/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove debug print.naruse2009-07-091-1/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (r_object0): replace \u by u when the regexp isnaruse2009-07-091-1/+12
| | | | | | made by Ruby 1.8. [ruby-dev:36750] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (w_encoding): encodings need extra depth.nobu2009-06-301-3/+3
| | | | | | | [ruby-core:24100] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (r_ivar): should not set internal encoding ivar as annobu2009-06-131-3/+3
| | | | | | | ordinary ivar. [ruby-dev:38596] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (w_encoding): more compact encoding information formatz2009-05-271-0/+19
| | | | | | | | US-ASCII and UTF-8. [incompatible] [experimental] * marshal.c (r_ivar): restore :E encoding information. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * common.mk (bignum.o, numeric.o): depend on util.h.nobu2009-05-261-21/+10
| | | | | | | | | | | * bignum.c, marshal.c: fixed types. * numeric.c (infinite_value): use ruby_div0. * include/ruby/util.h (ruby_div0): moved from marshal.c. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, bignum.c, dln.c, error.c, gc.c, io.c, marshal.c,nobu2009-03-121-5/+5
| | | | | | | | | | numeric.c, pack.c, strftime.c, string.c, thread.c, transcode.c, transcode_data.h, util.c, variable.c, vm_dump.c, include/ruby/encoding.h, missing/crypt.c, missing/vsnprintf.c: suppress VC type warnings. [ruby-core:22726] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (div0), numeric.c (infinite_value): new functions tonobu2009-03-121-4/+18
| | | | | | | get rid of VC divion by 0 warnings. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* stripped trailing spaces.nobu2009-02-221-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix grammos regarding the verb "refer".knu2009-02-101-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (marshal_dump): fixed for check_dump_arg.nobu2008-10-011-19/+22
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (marshal_dump): initializes dump_arg before any funcall.nobu2008-10-011-10/+12
| | | | | | | [ruby-dev:36648] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c, include/ruby/ruby.h: rename rb_register_mark_object()ko12008-09-151-1/+1
| | | | | | | | | | | | | | to rb_gc_register_mark_object(). * eval.c, vm.c: initialize vm->mark_object_ary at Init_top_self(). * bignum.c, complex.c, encoding.c, ext/win32ole/win32ole.c, io.c, load.c, marshal.c, rational.c, ruby.c, vm.c: use rb_gc_register_mark_object() instead of rb_global_variable() or rb_gc_register_address(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (DBL2NUM): renamed from DOUBLE2NUM.matz2008-09-051-1/+1
| | | | | | | a patch from Tadashi Saito <shiba at mail2.accsnet.ne.jp> in [ruby-dev:36102]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (struct load_arg): data is now st_table.nobu2008-09-021-17/+27
| | | | | | | | | | | * marshal.c (mark_load_arg): marks data and compat_tbl. * marshal.c (r_object0): no need to check if reentered. * marshal.c (marshal_load): make the wrapper with mark_load_arg. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_intern_const): tiny optimization.nobu2008-08-161-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (marshal_load): set arg.untrust properly.shugo2008-08-131-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_untrusted): new method Object#untrusted?.shugo2008-08-131-0/+14
| | | | | | | | | | | | | | | (rb_obj_untrust): new method Object#untrust. (rb_obj_trust): new method Object#trust. * array.c, debug.c, time.c, include/ruby/ruby.h, re.c, variable.c, string.c, io.c, dir.c, vm_method.c, struct.c, class.c, hash.c, ruby.c, marshal.c: fixes for Object#untrusted?. * test/ruby/test_module.rb, test/ruby/test_array.rb, test/ruby/test_object.rb, test/ruby/test_string.rb, test/ruby/test_marshal.rb, test/ruby/test_hash.rb: added tests for Object#untrusted?. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (dump_ensure), process.c (run_exec_dup2),nobu2008-08-041-0/+1
| | | | | | | | | string.c (rb_str_replace), transcode.c (transcode_dispatch): fixed memory leaks. based on patches from shinichiro.h <shinichiro.hamaji AT gmail.com> at [ruby-dev:35751]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (sizeof ptrdiff_t): check for size of ptrdiff_t.nobu2008-07-121-2/+2
| | | | | | | | | | | | | * include/ruby/ruby.h (PRI?PTRDIFF, PRI?SIZE): printf conversion specifiers for ptrdiff_t and size_t/ssize_t. * insns.def (leave), marshal.c (long_toobig), transcode.c (str_transcode), vm_dump.c (control_frame_dump, stack_dump_each), (debug_print_register, debug_print_pre): t and z length modifiers are C99. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (struct RRegexp): new field usecnt. replaceakr2008-06-281-4/+7
| | | | | | | | | | | | | | | | | | | | | str and len by src. * gc.c (gc_mark_children): mark src field of regexp. (obj_free): don't free str field. * re.c (REG_BUSY): removed. (rb_reg_initialize): prohibit re-initialize regexp. (rb_reg_search): use usecnt to prevent freeing regexp currently using. this prevents SEGV by: r = /\A((a.)*(a.)*)*b/ r =~ "ab" + "\xc2\xa1".force_encoding("euc-jp") t = Thread.new { r =~ "ab"*8 + "\xc2\xa1".force_encoding("utf-8")} sleep 0.2 r =~ "ab"*8 + "\xc2\xa1".force_encoding("euc-jp") git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (w_object, marshal_dump, r_object0, marshal_load): searchnobu2008-06-181-11/+11
| | | | | | | | | | | | public methods only. [ruby-core:17283] * object.c (convert_type): ditto. * lib/singleton.rb (Singleton#_dump): conversion method should be public. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.nobu2008-06-091-0/+2
| | | | | | | * *.c: no cache in init functions. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (w_object): add a check for modification of array duringmame2008-06-021-5/+6
| | | | | | | its dump. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * rational.c (string_to_r_internal): use rb_isdigit.naruse2008-06-011-1/+1
| | | | | | | | * marshal.c (long_toobig): use %zd. * ruby.c (set_arg0): move unused variable definition. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppress warnings with -Wwrite-string.nobu2008-05-311-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e