<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_syntax.rb, branch v3_4_9</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Add a test case for `it` in a regex.</title>
<updated>2025-09-16T20:36:08+00:00</updated>
<author>
<name>Nick Dower</name>
<email>nicholasdower@gmail.com</email>
</author>
<published>2025-05-16T13:44:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b5346f2c5be00f886c9ad2f4b807deb728265a0a'/>
<id>b5346f2c5be00f886c9ad2f4b807deb728265a0a</id>
<content type='text'>
Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #21313] Handle `it` in rescue and ensure blocks.</title>
<updated>2025-09-16T20:36:08+00:00</updated>
<author>
<name>Nick Dower</name>
<email>nicholasdower@gmail.com</email>
</author>
<published>2025-05-16T03:18:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1f6d845011cf8900c0e9c6fe5e4243a63a5ecae3'/>
<id>1f6d845011cf8900c0e9c6fe5e4243a63a5ecae3</id>
<content type='text'>
The following is crashing for me:

```shell
ruby --yjit --yjit-call-threshold=1 -e '1.tap { raise rescue p it }'

ruby: YJIT has panicked. More info to follow...
thread '&lt;unnamed&gt;' panicked at ./yjit/src/codegen.rs:2402:14:
...
```

It seems `it` sometimes points to the wrong value:

```shell
ruby -e '1.tap { raise rescue p it }'
false

ruby -e '1.tap { begin; raise; ensure; p it; end } rescue nil'
false
```

But only when `$!` is set:

```shell
ruby -e '1.tap { begin; nil; ensure; p it; end }'
1

ruby -e '1.tap { begin; nil; rescue; ensure; p it; end }'
1

ruby -e '1.tap { begin; raise; rescue; ensure; p it; end }'
1
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The following is crashing for me:

```shell
ruby --yjit --yjit-call-threshold=1 -e '1.tap { raise rescue p it }'

ruby: YJIT has panicked. More info to follow...
thread '&lt;unnamed&gt;' panicked at ./yjit/src/codegen.rs:2402:14:
...
```

It seems `it` sometimes points to the wrong value:

```shell
ruby -e '1.tap { raise rescue p it }'
false

ruby -e '1.tap { begin; raise; ensure; p it; end } rescue nil'
false
```

But only when `$!` is set:

```shell
ruby -e '1.tap { begin; nil; ensure; p it; end }'
1

ruby -e '1.tap { begin; nil; rescue; ensure; p it; end }'
1

ruby -e '1.tap { begin; raise; rescue; ensure; p it; end }'
1
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Backport Bug #21031</title>
<updated>2025-02-14T18:19:25+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2025-02-14T17:51:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=45fe3c137b6cc0b2546493e37d6334d8f39e076d'/>
<id>45fe3c137b6cc0b2546493e37d6334d8f39e076d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "merge revision(s) cb419e3912f0514b8151469b0a4a4b83cbbcce78: [Backport #21031]"</title>
<updated>2025-02-14T05:20:27+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-02-14T05:20:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=de7a196bd4b22f6073e6cf6c2d7d6fd8171b6baa'/>
<id>de7a196bd4b22f6073e6cf6c2d7d6fd8171b6baa</id>
<content type='text'>
This reverts commit 7adf89d7ad30552d7e57709d24eec266f601d38b.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 7adf89d7ad30552d7e57709d24eec266f601d38b.
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) cb419e3912f0514b8151469b0a4a4b83cbbcce78: [Backport #21031]</title>
<updated>2025-02-14T05:06:50+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-02-14T05:06:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7adf89d7ad30552d7e57709d24eec266f601d38b'/>
<id>7adf89d7ad30552d7e57709d24eec266f601d38b</id>
<content type='text'>
	[PRISM] Handle forwarding inside eval

	Fixes [Bug #21031]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[PRISM] Handle forwarding inside eval

	Fixes [Bug #21031]
</pre>
</div>
</content>
</entry>
<entry>
<title>Add a test case for nested block `it`</title>
<updated>2024-12-23T05:53:51+00:00</updated>
<author>
<name>yui-knk</name>
<email>spiketeika@gmail.com</email>
</author>
<published>2024-12-23T04:58:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=18580bc4e0296dac77d583c037f6346441773e02'/>
<id>18580bc4e0296dac77d583c037f6346441773e02</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[Bug #20965] Define `it` like an ordinary argument" (#12418)</title>
<updated>2024-12-23T04:46:50+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-12-23T04:46:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=667a0f9f928be843a0810f2c61b633be1f8cd46a'/>
<id>667a0f9f928be843a0810f2c61b633be1f8cd46a</id>
<content type='text'>
Revert "[Bug #20965] Define `it` like an ordinary argument (#12398)"

Reverts ruby/ruby#12398 as per https://bugs.ruby-lang.org/issues/20970#note-6 and https://bugs.ruby-lang.org/issues/20965#note-7.
We need more time to design the intended behavior, and it's too late for Ruby 3.4.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Revert "[Bug #20965] Define `it` like an ordinary argument (#12398)"

Reverts ruby/ruby#12398 as per https://bugs.ruby-lang.org/issues/20970#note-6 and https://bugs.ruby-lang.org/issues/20965#note-7.
We need more time to design the intended behavior, and it's too late for Ruby 3.4.</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #20965] Define `it` like an ordinary argument (#12398)</title>
<updated>2024-12-19T07:12:16+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-12-19T07:12:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=46fec0f62a1803d44edb8b06e39ac0f358e56670'/>
<id>46fec0f62a1803d44edb8b06e39ac0f358e56670</id>
<content type='text'>
Also fixes [Bug #20955]</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also fixes [Bug #20955]</pre>
</div>
</content>
</entry>
<entry>
<title>Fix memory leak in syntax error in prism</title>
<updated>2024-10-16T18:52:46+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-10-15T19:46:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=90aa6aefc4e351d3840cfd58872c5f42a11f4c7a'/>
<id>90aa6aefc4e351d3840cfd58872c5f42a11f4c7a</id>
<content type='text'>
If there is a syntax error, there could be an ast_node in the result.
This could get leaked if there is a syntax error so parsing could not
complete (parsed is not set to true).

For example, the following script leaks memory:

    10.times do
      10_000.times do
        eval("def foo(...) super(...) {}; end")
      rescue SyntaxError
      end

      puts `ps -o rss= -p #{$$}`
    end

Before:

    31328
    42768
    53856
    65120
    76208
    86768
    97856
    109120
    120208
    131296

After:

    20944
    20944
    20944
    20944
    20944
    20944
    20944
    20944
    20944
    20944
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If there is a syntax error, there could be an ast_node in the result.
This could get leaked if there is a syntax error so parsing could not
complete (parsed is not set to true).

For example, the following script leaks memory:

    10.times do
      10_000.times do
        eval("def foo(...) super(...) {}; end")
      rescue SyntaxError
      end

      puts `ps -o rss= -p #{$$}`
    end

Before:

    31328
    42768
    53856
    65120
    76208
    86768
    97856
    109120
    120208
    131296

After:

    20944
    20944
    20944
    20944
    20944
    20944
    20944
    20944
    20944
    20944
</pre>
</div>
</content>
</entry>
<entry>
<title>Suppress warnings with `RUBYPOT=-w`</title>
<updated>2024-10-10T04:23:07+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-10-10T04:23:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e00b746b7578ed7b2f168cb7bc867ef3c8cbca69'/>
<id>e00b746b7578ed7b2f168cb7bc867ef3c8cbca69</id>
<content type='text'>
```
-:3: warning: assigned but unused variable - var
-:3: warning: assigned but unused variable - var
-:3: warning: assigned but unused variable - var
-:3: warning: assigned but unused variable - var
-:3: warning: assigned but unused variable - var
-:3: warning: assigned but unused variable - var
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
```
-:3: warning: assigned but unused variable - var
-:3: warning: assigned but unused variable - var
-:3: warning: assigned but unused variable - var
-:3: warning: assigned but unused variable - var
-:3: warning: assigned but unused variable - var
-:3: warning: assigned but unused variable - var
```
</pre>
</div>
</content>
</entry>
</feed>
