summaryrefslogtreecommitdiff
path: root/prism/regexp.c
AgeCommit message (Collapse)Author
2025-01-11[ruby/prism] Enable implicit fall-through errorsAlexander Momchilov
https://github.com/ruby/prism/commit/03797b84d3
2024-11-12[ruby/prism] Fix use of uninitialized value when parsing regexpPeter Zhu
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
2024-08-22[ruby/prism] Turn off extended mode when parsing extended groupKevin Newton
https://github.com/ruby/prism/commit/098b3f08bc
2024-07-01[ruby/prism] Properly support parsing regexp in extended modeKevin Newton
https://github.com/ruby/prism/commit/bedc4585ed
2024-06-05[ruby/prism] Parse all regular expressionsKevin Newton
https://github.com/ruby/prism/commit/11e0e204ce
2024-06-05[ruby/prism] Add Onigmo errors for invalid groupsKevin Newton
https://github.com/ruby/prism/commit/27e7685dd4
2024-06-05[ruby/prism] Add Onigmo error for invalid repeat and empty group nameKevin Newton
https://github.com/ruby/prism/commit/953601e3c0
2024-06-05[ruby/prism] Add Onigmo error for empty char-classKevin Newton
https://github.com/ruby/prism/commit/2e02fa3b80
2024-06-05[ruby/prism] Report onigmo errors for depthKevin Newton
https://github.com/ruby/prism/commit/e0e8bba8be
2024-06-05[ruby/prism] Change pm_regexp_parse to not return booleanKevin Newton
https://github.com/ruby/prism/commit/b03afbe857
2024-06-05[ruby/prism] Pass prism parser into regexp parserKevin Newton
https://github.com/ruby/prism/commit/c19b0fa185
2024-06-05[ruby/prism] Switch regexp parsing to use a callback from named capture groupsKevin Newton
https://github.com/ruby/prism/commit/29d80e486e
2024-02-18[ruby/prism] Account for encoding in regexp named capturesKevin Newton
https://github.com/ruby/prism/commit/17dc6b6281
2023-11-30[ruby/prism] Correctly pass around const pm_encoding_t *Kevin Newton
https://github.com/ruby/prism/commit/ce4c67fb3a
2023-11-05Do not use non-ASCII chars in sourcesNobuyoshi Nakada
No encodings are guaranteed in C compilers, and other than UTF-8 encodings may be assumed in some platforms, e.g., CP932 on Windows Japanese edition, and may result in compilation errors.
2023-11-01[ruby/prism] Last remaining missing C commentsKevin Newton
https://github.com/ruby/prism/commit/e327449db6
2023-11-01[ruby/prism] Documentation for diagnostics and regexpKevin Newton
https://github.com/ruby/prism/commit/16e0579044
2023-10-27[ruby/prism] Use MatchWriteNode on split InterpolatedRENKevin Newton
https://github.com/ruby/prism/commit/ee54244800
2023-09-27Sync to prism rename commitsKevin Newton
2023-09-27Rename YARP filepaths to prism filepathsKevin Newton
close