[ruby-cvs:53910] ko1:r46764 (trunk): * parse.y: change Symbol <-> ID relationship to avoid

ko1 at ruby-lang.org ko1 at ruby-lang.org
Wed Jul 9 15:15:01 JST 2014


ko1	2014-07-09 15:14:41 +0900 (Wed, 09 Jul 2014)

  New Revision: 46764

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

  Log:
    * parse.y: change Symbol <-> ID relationship to avoid
      exposing IDs from collectable symbols.
      [Bug #10014]
      Now, rb_check_id() returns 0 if corresponding symbol is
      pinned dynamic symbol.
      There is remaining intern_cstr_without_pindown(), it can return
      IDs from collectable symbols. We must be careful to use it
      (only used in parse.y).  I think it should be removed if
      it does not have impact for performance.
    * parse.y:
      add:
      * STATIC_SYM2ID()
      * STATIC_ID2SYM()
      rename:
      * rb_pin_dynamic_symbol() -> dsymbol_pindown()
    * internal.h:
      remove:
      * rb_check_id_without_pindown()
      * rb_sym2id_without_pindown()
      add:
      * rb_check_symbol()
      * rb_check_symbol_cstr()
    * load.c: use rb_check_id() or rb_check_id_cstr().
    * object.c: ditto.
    * struct.c: ditto.
    * thread.c: ditto.
    * vm_method.c: ditto.
    * string.c (sym_find): use only rb_check_symbol().
    * sprintf.c (rb_str_format): use rb_check_symbol_cstr().

  Modified files:
    trunk/ChangeLog
    trunk/internal.h
    trunk/load.c
    trunk/object.c
    trunk/parse.y
    trunk/sprintf.c
    trunk/string.c
    trunk/struct.c
    trunk/thread.c
    trunk/variable.c
    trunk/vm_method.c


More information about the ruby-cvs mailing list