summaryrefslogtreecommitdiff
path: root/test/ruby/test_marshal.rb
AgeCommit message (Collapse)Author
2019-07-01marshal.c: check instance variable countNobuyoshi Nakada
* marshal.c (w_ivar_each): ensure that no instance variable was removed while dumping other instance variables. [Bug #15968]
2019-07-01marshal.c: check instance variable countNobuyoshi Nakada
* marshal.c (w_obj_each): ensure that no instance variable was added while dumping other instance variables. [Bug #15968]
2018-01-05marshal.c: allow marshalling keyword_init structk0kubun
struct.c: define rb_struct_s_keyword_init to shared with marshal.c internal.h: add the declaration to be used by marshal.c test/ruby/test_marshal.rb: add test for Bug#14314 [Feature #14314] [ruby-core:84629] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Add FrozenError as a subclass of RuntimeErrorshyouhei
FrozenError will be used instead of RuntimeError for exceptions raised when there is an attempt to modify a frozen object. The reason for this change is to differentiate exceptions related to frozen objects from generic exceptions such as those generated by Kernel#raise without an exception class. From: Jeremy Evans <code@jeremyevans.net> Signed-off-by: Urabe Shyouhei <shyouhei@ruby-lang.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-06Rename RbConfig::Limits as RbConfig::LIMITSnobu
* template/limits.c.tmpl (Init_limits): rename RbConfig::Limits as RbConfig::LIMITS, constants other than class or module are all uppercase with underscores by convention. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-02test: use RbConfig::Limitsnobu
* test/lib/envutil.rb: rbconfig/sizeof may not be available when cross-compiling. use RbConfig::Limits instead of calculating limits of Fixnum with hard-coded CHAR_BIT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-15marshal.c: revert r57631 partiallynobu
* marshal.c (rb_marshal_dump_limited): do not free dump_arg, which may be dereferenced in check_dump_arg due to continuation, and get rid of dangling pointers. * marshal.c (rb_marshal_load_with_proc): ditto for load_arg. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-24marshal.c: fix infinite recursionnobu
* marshal.c (check_userdump_arg): marshal_dump should not return an instance of the same class, otherwise it causes infinite recursion. [ruby-core:78289] [Bug #12974] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-24No respond_to? as if the default definitionnobu
* vm_method.c (vm_respond_to): try method_missing if respond_to? is undefined, as if it is the default definition. [ruby-core:75377] [Bug #12353] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-19variable.c: consider lengthnobu
* variable.c (rb_path_to_class): consider the string length instead of a terminator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-01envutil.rb defines Integer::{FIXNUM_MIN,FIXNUM_MAX}.akr
* test/lib/envutil.rb: Define Integer::{FIXNUM_MIN,FIXNUM_MAX}. * test/ruby/test_bignum.rb: Use Integer::{FIXNUM_MIN,FIXNUM_MAX}. * test/ruby/test_bignum.rb: Ditto. * test/ruby/test_integer_comb.rb: Ditto. * test/ruby/test_marshal.rb: Ditto. * test/ruby/test_optimization.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-17test_marshal.rb: assert bad linknobu
* test/ruby/test_marshal.rb (test_marshal_load_r_prepare_reference_crash): assert an ArgumentError exception at a bad link. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-16* marshal.c (r_object0): raise ArgumentError when linking to undefineddrbrain
object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-15test_marshal.rb: use assert_ruby_statusnobu
* test/ruby/test_marshal.rb (test_marshal_load_extended_class_crash): use assert_ruby_status to deal with signals, core dump and diagnostic reports. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-14* marshal.c (r_object0): Fix Marshal crash for corrupt extended object.drbrain
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-21* marshal.c (r_object0): honor Marshal.load post procnaruse
value for TYPE_LINK. by Hiroshi Nakamura <nahi@ruby-lang.org> https://github.com/ruby/ruby/pull/1204 fix GH-1204 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-21ruby.c: --debug=frozen-string-literal optionnobu
* ruby.c (need_argument): move frozen-string-literal-debug option from --enable to --debug. [Feature #11725] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-27test_marshal.rb: test_no_internal_idsnobu
* test/ruby/test_marshal.rb (test_no_internal_ids): test for r52304, no internal IDs should be exposed by Marshal.dump. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-16marshal.c: class name encodingnobu
* marshal.c (r_object0): preserve the encoding of the class name in an error message, in the case of USRMARSHAL without marshal_load method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-16marshal.c: class name encodingnobu
* marshal.c (r_object0): preserve the encoding of the class name in an error message, in the case of USERDEF without _load singleton method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-16marshal.c: class name encodingnobu
* marshal.c (r_object0): preserve the encoding of the class name in an error message, in the case of no _load_data method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-16marshal.c: class name encodingnobu
* marshal.c (w_object): preserve the encoding of the class name in an error message, in the case of no _dump_data method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-16marshal.c: class name encodingnobu
* marshal.c (w_object): preserve the encoding of the class name in an error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-22marshal.c: register symbol strings firstnobu
* marshal.c (r_symreal): register symbol names as strings first so that r_symlink always returns valid names. [ruby-core:68587] [Bug #10991] * marshal.c (r_ivar, r_object0): now need to intern symbol names. * marshal.c (r_object0): compare with symbol names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-29marshal.c: fix symlink indexnobu
* marshal.c (w_symbol): fix symlink index. register the given symbols, not its name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-31Join threads before close pipes.akr
closing a FD interrupts threads which uses the FD. rb_thread_io_blocking_region (for write()) checks an interrupt after write() is finished. So, joining the thread after closing() may raise "IOError: stream closed". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-31Join threads.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-17marshal.c: do not recycle wrapper objectsnobu
* marshal.c (marshal_dump, marshal_load): do not recycle wrapper objects, to prevent from segfault with continuation. [ruby-dev:47970] [Bug #9523] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-08marshal.c: Numerics are not taintednobu
* include/ruby/ruby.h (OBJ_TAINTABLE, OBJ_TAINT, OBJ_INFECT), marshal.c (r_entry0): all Numerics never be tainted now. [ruby-core:57346] [Bug #8945] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-06test_marshal.rb: fix test depending on heap addressnobu
* test/ruby/test_marshal.rb (test_packed_string): explicitly force encoding for the case packed string is 7bit ASCII only. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05pack.c: hide associated objectsnobu
* marshal.c (to_be_skipped_id): ignore anonymous attributes. * pack.c (Init_pack): use anonymous ID so that associated objects do not appear in the packed result. * parse.y (rb_make_internal_id): return an anonymous ID for internal use. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13test/ruby: better assertionsnobu
* test/ruby: use better assertions instead of mere assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-09test/ruby: assert_raise_with_messagenobu
* test/ruby: use assert_raise_with_message git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-13* test/-ext-/test_printf.rb, test/rss/test_parser.rb,shugo
test/ruby/test_array.rb, test/ruby/test_hash.rb, test/ruby/test_m17n.rb, test/ruby/test_marshal.rb, test/ruby/test_object.rb, test/ruby/test_string.rb: don't use untrusted?, untrust, and trust to avoid warnings in case $VERBOSE is true. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-02marshal.c: no overwriting ivarsnobu
* marshal.c (copy_ivar_i): get rid of overwriting already copied instance variales. c.f. [Bug #8276] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-22marshal.c: fix marshal_load ivarnobu
* marshal.c (r_object0): copy all instance variables not only generic ivars, before calling post proc. [ruby-core:51163] [Bug #7627] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-20* test/csv/test_features.rb, test/logger/test_logger.rbakr
test/mkmf/test_have_macro.rb, test/net/http/test_http.rb, test/openssl/test_config.rb, test/psych/test_encoding.rb, test/psych/test_exception.rb, test/psych/test_psych.rb, test/psych/test_tainted.rb, test/readline/test_readline.rb, test/rexml/test_contrib.rb, test/ruby/test_autoload.rb, test/ruby/test_beginendblock.rb, test/ruby/test_exception.rb, test/ruby/test_file.rb, test/ruby/test_io.rb, test/ruby/test_marshal.rb, test/ruby/test_process.rb, test/ruby/test_require.rb, test/ruby/test_rubyoptions.rb, test/syslog/test_syslog_logger.rb, test/webrick/test_httpauth.rb, test/zlib/test_zlib.rb: Use Tempfile.create. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-20marshal.c: use ivars of marshal_dump datanobu
* marshal.c (w_object): dump no ivars to the original by marshal_dump. [ruby-core:54334] [Bug #8276] * marshal.c (r_object0): copy all ivars of marshal_dump data to the result object instead. [ruby-core:51163] [Bug #7627] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-19marshal.c: no duplicated encodingnobu
* marshal.c (w_object): do not dump encoding which is dumped with marshal_dump data. [ruby-core:54334] [Bug #8276] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-05vm_method.c: drop include_all flagnobu
* vm_method.c (rb_obj_respond_to): drop optional include_all flag if respond_to? method is defined in old style. [Bug #7722] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-01marshal.c: prohibit_ivarnobu
* marshal.c (r_object0): prohibit setting instance variables of exising class/module. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-29* test/ruby/test_marshal.rb: remove temporally files early.akr
* test/ruby/test_process.rb: ditto. * test/psych/test_exception.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-26marshal.c: marshal_dump instance varialbesnobu
* marshal.c (w_object): dump instance varialbes of the result of marshal_dump not the original object. [ruby-core:51163] [Bug #7627] * complex.c (nucomp_marshal_dump): need to copy instance variables. * rational.c (nurat_marshal_dump): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-13* marshal.c (r_entry0): don't taint classes and modules becauseshugo
Marshal.load just return the dumped classes and modules. [Bug #7325] [ruby-core:49198] * test/ruby/test_marshal.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-16* marshal.c (w_object): add flonum to arg->data to keep reference indexnagachika
consistency. [ruby-core:49323] [Bug #7348] * test/ruby/test_marshal.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-15test/ruby/test_marshal.rb: close pipesnobu
* test/ruby/test_marshal.rb (TestMarshal#test_pipe): should close pipes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-28* marshal.c (r_symreal): default to ASCII-8BIT for non-ascii symbols,nobu
otherwise it should be converted to US-ASCII in rb_intern_str() if possible. [ruby-core:43762][Bug #6209] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-25* complex.c (nucomp_marshal_load): raise error on invalid data.naruse
reported by John Firebaugh [ruby-core:42860] [Bug #6076] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-01* test/ruby/test_marshal.rb: renamed methods duplicated with thoseshugo
of marshaltestlib.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e