[ruby-cvs:70867] ko1:r63777 (trunk): check enc_capable.

ko1 at ruby-lang.org ko1 at ruby-lang.org
Thu Jun 28 17:35:49 JST 2018


ko1	2018-06-28 17:35:48 +0900 (Thu, 28 Jun 2018)

  New Revision: 63777

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63777

  Log:
    check enc_capable.
    
    * encoding.c (rb_enc_capable): make it extern to check enc_capable.
      enc_index can be set to limited types such as T_STRING, T_REGEX
      and so on. This function check an object is this kind of types.
    
    * include/ruby/encoding.h: ditto.
    
    * encoding.c (enc_set_index): check a given object is enc_capable.
    
    * include/ruby/encoding.h (PUREFUNC):
    
    * marshal.c (encoding_name): check `rb_enc_capable` first.
    
    * marshal.c (r_ivar): ditto. If it is not enc_capable, it should be
      malformed data.
    
    * spec/ruby/optional/capi/encoding_spec.rb: remove tests depending
      on the wrong feature: all objects can set enc_index.

  Modified files:
    trunk/encoding.c
    trunk/include/ruby/encoding.h
    trunk/marshal.c
    trunk/spec/ruby/optional/capi/encoding_spec.rb


More information about the ruby-cvs mailing list