summaryrefslogtreecommitdiff
path: root/marshal.c
AgeCommit message (Collapse)Author
2013-03-09marshal.c: check for prependednobu
* marshal.c (w_extended): check for prepended object. [ruby-core:53206] [Bug #8043] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-08marshal.c: prepended objectsnobu
* marshal.c (r_object0): load prepended objects. treat the class of extended object in the included modules as prepended singleton class. [ruby-core:53202] [Bug #8041] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-01* marshal.c: add security considerations to marshal overview, refer tocharliesome
overview from Marshal.load documentation [#7759] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39005 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-31marshal.c: warn against using Marshal.load on untrusted datacharliesome
* marshal.c (marshal_load): Add documentation warning against using Marshal.load on untrusted data [Bug #7759] [ruby-core:51765] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38999 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
2013-01-20marshal.c: get back to the old behaviornobu
* marshal.c (w_object, r_object0): separate respond_to checks and calling, and get back to the old behavior for 2.0. [Bug #7564] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-23marshal.c: rb_check_funcall_with_hooknobu
* vm_eval.c (rb_check_funcall_with_hook): rb_check_funcall with hook which is called before calling method_missing or target method. * marshal.c (w_object, r_object0): use rb_check_funcall_with_hook instead of respond_to? and call. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-23marshal.c: use RB_TYPE_Pnobu
* marshal.c (r_entry0): use RB_TYPE_P. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-19* marshal.c (marshal_dump, marshal_load): fix SEGV during make rdocngoto
and test failure in TestMarshal#test_gc and test_context_switch on SPARC Solaris 10 compiled with Oracle Solaris Studio 12.3. [Bug #7591] [ruby-dev:46772] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38473 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-12-04marshal.c: PRIsVALUEnobu
* marshal.c (path2class, path2module): use PRIsVALUE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-04marshal.c: rb_check_funcallnobu
* marshal.c (w_object, marshal_dump, marshal_load): use rb_check_funcall if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-04marshal.c: GC guardnobu
* marshal.c (w_object, marshal_dump, r_object0, marshal_load): use RB_GC_GUARD() (directly or indirectly) instead of volatile. * variable.c (rb_path_to_class): prevent the arguemnt from GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-01marshal.c: private methodsnobu
* marshal.c (w_object, r_object0): call private marshal methods. [Feature #6539] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-20* marshal.c: add marshal readahead. marshalized Array, Hash and Structglass
have size at least number of its elements, marshal readahead will read the certain readable length and buffer when it needs more bytes. marshal readahead prevents many calls to IO#getbyte and IO#read, then it enables performace improvement. [ruby-dev:45637] [Feature #6440] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37772 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-10-20* include/ruby/ruby.h: add C APIs.nari
VALUE rb_newobj_of(VALUE klass, VALUE flags) #define NEWOBJ_OF(obj,type,klass,flags) These allow to change a allocation strategy depending on klass or flags. * gc.c: ditto * array.c: use new C API. * bignum.c: ditto * class.c: ditto * complex.c: ditto * ext/socket/ancdata.c: ditto * ext/socket/option.c: ditto * hash.c: ditto * io.c: ditto * marshal.c: ditto * numeric.c: ditto * object.c: ditto * random.c: ditto * range.c: ditto * rational.c: ditto * re.c: ditto * string.c: ditto * struct.c: ditto [Feature #7177][Feature #7047] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-23* include/ruby/ruby.h: introduce flonum technique forko1
64bit CPU environment (sizeof(double) == sizeof(VALUE)). flonum technique enables to avoid double object creation if the double value d is in range about between 1.72723e-77 < |d| <= 1.15792e+77 or 0.0. flonum Float value is immediate and their lowest two bits are b10. If flonum is activated, then USE_FLONUM macro is 1. I'll write detailed in this technique on https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/Flonum_tech * benchmark/bmx_temp.rb: add an benchmark for simple Float calculation. * gc.c (id2ref, rb_obj_id): add flonum Float support. * include/ruby/intern.h: move decl of rb_float_new(double) to include/ruby/ruby.h. * insns.def, vm.c, vm_insnhelper.c: add flonum optimization and simplify source code. * vm_insnhelper.h (FLONUM_2_P): added. * marshal.c: support flonum output. * numeric.c (rb_float_new_in_heap): added. * parse.y: support flonum. * random.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22marshal.c: io_needednobu
* marshal.c (io_needed): extract from marshal_dump and marshal_load. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-04compatible loadernobu
* marshal.c (r_object0): also load TYPE_USRMARSHAL, TYPE_DATA using compatible loader. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-03adjust indentnobu
* marshal.c (r_object0): adjust indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-03remove old warningnobu
* marshal.c (r_object0): remove old warning for _alloc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-03 * marshal.c: experimental test aborted.tadf
* complex.c: ditto. * rational.c: ditto. * include/ruby/intern.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-03 * marshal.c: calls directly rb_{Complex,Rational}_marshal_load().tadf
But now disabled. [experimental] * complex.c: followed the above. * rational.c: ditto. * include/rub/intern.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-03use rb_marshal_{dump,load}nobu
* marshal.c: revert r35879 "now marshal_{load|dump} are external." * complex.c (nucomp_marshal__{dump,load}): should use rb_marshal_{dump,load}. * rational.c (nurat_marshal__{dump,load}): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-03now marshal_{load|dump} are external.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-23use RB_TYPE_P() instead of comparison of TYPE()nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-15* reduce UNREACHABLE.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-13* encoding.c (rb_enc_codepoint_len): Use UNREACHABLE to avoid "controldrbrain
reaches end of non-void function" warnings. [ruby-trunk - Bug #6066] * re.c (name_to_backref_number): ditto. * object.c (rb_Float): ditto. * io.c (io_readpartial): ditto. * io.c (io_read_nonblock): ditto. * pack.c (rb_uv_to_utf8): ditto. * proc.c (rb_method_entry_arity): ditto. * vm_method.c (rb_f_notimplement): ditto. * struct.c (rb_struct_aset_id): ditto. * class.c (rb_scan_args): ditto. * process.c (rlimit_resource_type): ditto. * process.c (rlimit_resource_value): ditto. * process.c (p_uid_switch): ditto. * process.c (p_gid_switch): ditto. * ext/digest/digest.c (rb_digest_instance_update): ditto. * ext/digest/digest.c (rb_digest_instance_finish): ditto. * ext/digest/digest.c (rb_digest_instance_reset): ditto. * ext/digest/digest.c (rb_digest_instance_block_length): ditto. * ext/bigdecimal/bigdecimal.c (BigDecimalCmp): ditto. * ext/dl/handle.c (rb_dlhandle_close): ditto. * ext/tk/tcltklib.c (pending_exception_check0): ditto. * ext/tk/tcltklib.c (pending_exception_check1): ditto. * ext/tk/tcltklib.c (ip_cancel_eval_core): ditto. * ext/tk/tcltklib.c (lib_get_reltype_name): ditto. * ext/tk/tcltklib.c (create_dummy_encoding_for_tk_core): ditto. * ext/tk/tkutil/tkutil.c (tk_hash_kv): ditto. * ext/openssl/ossl_ssl.c (ossl_ssl_session_reused): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_dsa_verify_asn1): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_at_infinit): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_on_curve): ditto. * ext/fiddle/conversions.c (generic_to_value): ditto. * ext/socket/raddrinfo.c (rsock_io_socket_addrinfo): ditto. * ext/socket/socket.c (sock_s_getnameinfo): ditto. * ext/ripper/eventids2.c (ripper_token2eventid): ditto. * cont.c (return_fiber): ditto. * dmydln.c (dln_load): ditto. * vm_insnhelper.c (vm_search_normal_superclass): ditto. * bignum.c (big_fdiv): ditto. * marshal.c (r_symlink): ditto. * marshal.c (r_symbol): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-30* hash.c, marshal.c, object.c, variable.c: fix callback argument typesnobu
of iterators. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35183 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-03-28* marshal.c (r_symreal): no longer need volatile modifier, as usingnobu
rb_intern_str() not rb_intern(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-29* use RB_TYPE_P which is optimized for constant types, instead ofnobu
comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-05 * marshal.c (w_object): Fix exception message when _dump_data is notdrbrain
defined on a T_DATA object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17* internal.h: declare internal functions here.akr
* node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-18* internal.h: add for internal use only.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-07cancel subversion backfire. sorrymatz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-07* gc.c (rb_gc_set_params): allow GC parameter configuration bymatz
environment variables. based on a patch from funny-falcon at https://gist.github.com/856296, but honors safe level. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-05* class.c: fix camelCase to snake_case in documentation code examples.naruse
patched by Andrew Grimm. fixes Bug #4469 * marshal.c: ditto. * proc.c: ditto. * sample/biorhythm.rb: ditto. * vm_eval.c: ditto. * vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-15Fix typo of rdoc. [ruby-core:35016]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-19* marshal.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12* configure.in (RUBY_CHECK_PRINTF_PREFIX): check for printf formatnobu
specifier if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12* compile.c (iseq_build_body), error.c (set_syserr, get_syserr),nobu
(syserr_initialize), gc.c (define_final, rb_gc_copy_finalizer), (run_final), hash.c (rb_hash_aref, rb_hash_lookup2), (rb_hash_fetch_m, rb_hash_clear, rb_hash_aset, eql_i), iseq.c (iseq_load, iseq_data_to_ary), marshal.c (r_symlink), thread.c (rb_thread_local_aref), variable.c (generic_ivar_remove, ivar_get, rb_const_get_0), (rb_cvar_get), vm.c (rb_vm_check_redefinition_opt_method), vm_insnhelper.c (vm_get_ev_const), vm_method.c (remove_method), ext/iconv/iconv.c (map_charset): use st_data_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-05* marshal.c (w_float): should not append a dot if no fractal partnobu
exists. [ruby-dev:41936] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-18* include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]nobu
add parent member. * error.c (rb_typeddata_inherited_p): new function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-30* marshal.c (w_object): suppress empty instance variable entry onnobu
compatible dump objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-27* marshal.c (w_object, r_bytes0, marshal_load): suppress warnings.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-23* marshal.c (struct dump_arg, struct load_arg): merge taint andnobu
untrust flags into infection as bit flags. * marshal.c (w_nbyte, clear_dump_arg): infect the buffer as soon as appending, because it might have been finalized already at exit. based on a patch by Tomoyuki Chikanaga at [ruby-dev:41672]. [Bug #3463] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-26document marshal_dump and marshal_loaddrbrain
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e