Project

General

Profile

Actions

Bug #10266

closed

String#to_sym generates too big object_id?

Added by gussan (Hiroki Eguchi) over 10 years ago. Updated over 10 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.0dev (2014-09-19 trunk 47643) [x86_64-darwin13]
[ruby-dev:48564]

Description

Script

puts "hoge".to_sym.object_id
eval("def a(hoge:); end")

Result on ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]

$ ruby test_case.rb
420328

Result on ruby 2.2.0dev (2014-09-19 trunk 47643) [x86_64-darwin13]

$ ruby test_case.rb
70279604013940
test_case.rb:2:in `eval': integer 140559208027880 too big to convert to `int' (RangeError)
	from test_case.rb:2:in `<main>'

Updated by nobu (Nobuyoshi Nakada) over 10 years ago

  • Description updated (diff)
  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN to 2.0.0: DONTNEED, 2.1: DONTNEED

Updated by nobu (Nobuyoshi Nakada) over 10 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r47648.


compile.c: store IDs as Symbols

  • compile.c (iseq_set_arguments): store local variable IDs in
    temporary list as Symbols. previously these are stored as
    Fixnums to prevent from GC, but IDs of dynamic symbols can
    exceed Fixnum range and cause RangeError at inverting from
    Fixnum. ruby-dev:48564 [Bug #10266]

Updated by nobu (Nobuyoshi Nakada) about 10 years ago

  • Related to Bug #10283: Calling define_method with a dynamic symbol ending in = results in a NoMethodError when calling the method via assignment, until called via send added

Updated by nobu (Nobuyoshi Nakada) about 10 years ago

  • Related to deleted (Bug #10283: Calling define_method with a dynamic symbol ending in = results in a NoMethodError when calling the method via assignment, until called via send)
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0