[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-core
Subject:    [ruby-core:70957] [Ruby trunk - Bug #11557] [Closed] Capturing Limits
From:       nobu () ruby-lang ! org
Date:       2015-09-30 4:42:08
Message-ID: redmine.journal-54324.20150930044208.b11b6ab4768485f5 () ruby-lang ! org
[Download RAW message or body]

Issue #11557 has been updated by Nobuyoshi Nakada.

Description updated
Status changed from Open to Closed

----------------------------------------
Bug #11557: Capturing Limits
https://bugs.ruby-lang.org/issues/11557#change-54324

* Author: Ronald Petty
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: 2.2
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
Ruby 2.2

In IRB and via normal ruby file.rb, you can create unexpected behavior via capture groups.

Via IRB

~~~
"asdf".match(/(.)/)
$1
 => "a" 
$2000000
 => nil 
$2000000000000000
RangeError: integer 2467954688 too big to convert to `int'
$999999999999999999999999999999999999
 => "a" 
~~~

Via ruby

~~~
ruby a.rb (
"a"
ruby a.rb 
a.rb: integer 2467954690 too big to convert to `int' (RangeError)
ruby a.rb 
"a"
~~~



-- 
https://bugs.ruby-lang.org/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic