<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/prism/regexp.c, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/prism] Enable implicit fall-through errors</title>
<updated>2025-01-12T00:09:05+00:00</updated>
<author>
<name>Alexander Momchilov</name>
<email>alexandermomchilov@gmail.com</email>
</author>
<published>2024-12-18T18:37:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=fa1427a63e26d24b0aca37d66af705a57d2aa2e2'/>
<id>fa1427a63e26d24b0aca37d66af705a57d2aa2e2</id>
<content type='text'>
https://github.com/ruby/prism/commit/03797b84d3
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/03797b84d3
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Fix use of uninitialized value when parsing regexp</title>
<updated>2024-11-12T14:19:46+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-11-11T22:03:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=eca3680c274030215dc941584acb975a88a51fcb'/>
<id>eca3680c274030215dc941584acb975a88a51fcb</id>
<content type='text'>
Parsing the regexp /\A{/ causes uses an uninitialized value because it
tries to parse it as a range quantifier, so it reads the character after
the closing curly bracket. This is using uninitialized values because
prism strings are not null terminated. This can be seen in the Valgrind
output:

    ==834710== Conditional jump or move depends on uninitialised value(s)
    ==834710==    at 0x5DA010: pm_regexp_parse_range_quantifier (regexp.c:163)
    ==834710==    by 0x5DA010: pm_regexp_parse_quantifier (regexp.c:243)
    ==834710==    by 0x5DAD69: pm_regexp_parse_expression (regexp.c:738)
    ==834710==    by 0x5DAD69: pm_regexp_parse_pattern (regexp.c:761)
    ==834710==    by 0x5DAD69: pm_regexp_parse (regexp.c:773)
    ==834710==    by 0x5A2EE7: parse_regular_expression_named_captures (prism.c:20886)
    ==834710==    by 0x5A2EE7: parse_expression_infix (prism.c:21388)
    ==834710==    by 0x5A5FA5: parse_expression (prism.c:21804)
    ==834710==    by 0x5A64F3: parse_statements (prism.c:13858)
    ==834710==    by 0x5A9730: parse_program (prism.c:22011)
    ==834710==    by 0x576F0D: parse_input_success_p (extension.c:1062)
    ==834710==    by 0x576F0D: parse_success_p (extension.c:1084)

This commit adds checks for the end of the string to
pm_regexp_parse_range_quantifier.

https://github.com/ruby/prism/commit/be6cbc23ef
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Parsing the regexp /\A{/ causes uses an uninitialized value because it
tries to parse it as a range quantifier, so it reads the character after
the closing curly bracket. This is using uninitialized values because
prism strings are not null terminated. This can be seen in the Valgrind
output:

    ==834710== Conditional jump or move depends on uninitialised value(s)
    ==834710==    at 0x5DA010: pm_regexp_parse_range_quantifier (regexp.c:163)
    ==834710==    by 0x5DA010: pm_regexp_parse_quantifier (regexp.c:243)
    ==834710==    by 0x5DAD69: pm_regexp_parse_expression (regexp.c:738)
    ==834710==    by 0x5DAD69: pm_regexp_parse_pattern (regexp.c:761)
    ==834710==    by 0x5DAD69: pm_regexp_parse (regexp.c:773)
    ==834710==    by 0x5A2EE7: parse_regular_expression_named_captures (prism.c:20886)
    ==834710==    by 0x5A2EE7: parse_expression_infix (prism.c:21388)
    ==834710==    by 0x5A5FA5: parse_expression (prism.c:21804)
    ==834710==    by 0x5A64F3: parse_statements (prism.c:13858)
    ==834710==    by 0x5A9730: parse_program (prism.c:22011)
    ==834710==    by 0x576F0D: parse_input_success_p (extension.c:1062)
    ==834710==    by 0x576F0D: parse_success_p (extension.c:1084)

This commit adds checks for the end of the string to
pm_regexp_parse_range_quantifier.

https://github.com/ruby/prism/commit/be6cbc23ef
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Turn off extended mode when parsing extended group</title>
<updated>2024-08-22T14:43:35+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-08-22T14:22:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d57486cb100d6814423c0e22556266e67000d101'/>
<id>d57486cb100d6814423c0e22556266e67000d101</id>
<content type='text'>
https://github.com/ruby/prism/commit/098b3f08bc
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/098b3f08bc
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Properly support parsing regexp in extended mode</title>
<updated>2024-07-01T14:42:10+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-07-01T14:28:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8fb2227205c7c5c258bac0c3a721fa6916dd4c1e'/>
<id>8fb2227205c7c5c258bac0c3a721fa6916dd4c1e</id>
<content type='text'>
https://github.com/ruby/prism/commit/bedc4585ed
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/bedc4585ed
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Parse all regular expressions</title>
<updated>2024-06-05T18:40:03+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-06-05T15:45:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d13112b779d8dd8482f4a545655c37bdf860abf1'/>
<id>d13112b779d8dd8482f4a545655c37bdf860abf1</id>
<content type='text'>
https://github.com/ruby/prism/commit/11e0e204ce
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/11e0e204ce
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Add Onigmo errors for invalid groups</title>
<updated>2024-06-05T18:40:03+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-06-05T15:25:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2a9c20c317989d9b6807abe96f3d935635470372'/>
<id>2a9c20c317989d9b6807abe96f3d935635470372</id>
<content type='text'>
https://github.com/ruby/prism/commit/27e7685dd4
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/27e7685dd4
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Add Onigmo error for invalid repeat and empty group name</title>
<updated>2024-06-05T18:40:03+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-06-05T15:11:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0406efaf055d0db03d33ca215b407a2f74ce9bc1'/>
<id>0406efaf055d0db03d33ca215b407a2f74ce9bc1</id>
<content type='text'>
https://github.com/ruby/prism/commit/953601e3c0
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/953601e3c0
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Add Onigmo error for empty char-class</title>
<updated>2024-06-05T18:40:03+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-06-05T14:55:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d604287626cc5fdb63e8671c9733f177d5824b4f'/>
<id>d604287626cc5fdb63e8671c9733f177d5824b4f</id>
<content type='text'>
https://github.com/ruby/prism/commit/2e02fa3b80
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/2e02fa3b80
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Report onigmo errors for depth</title>
<updated>2024-06-05T18:40:03+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-06-05T14:50:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c3747d5a2e029afb9aabc0b2f122ab701e68f71f'/>
<id>c3747d5a2e029afb9aabc0b2f122ab701e68f71f</id>
<content type='text'>
https://github.com/ruby/prism/commit/e0e8bba8be
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/e0e8bba8be
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Change pm_regexp_parse to not return boolean</title>
<updated>2024-06-05T18:40:03+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-06-04T16:36:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=41f27346440eab0d80b8c50be8741e3344af9ed5'/>
<id>41f27346440eab0d80b8c50be8741e3344af9ed5</id>
<content type='text'>
https://github.com/ruby/prism/commit/b03afbe857
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/b03afbe857
</pre>
</div>
</content>
</entry>
</feed>
