| Age | Commit message (Collapse) | Author |
|
[Backport #21187]
|
|
|
|
[Bug #21161]
The `tolower` function provided by the libc is locale dependent
and can behave in ways you wouldn't expect for some value
of `LC_CTYPE`.
https://github.com/ruby/prism/commit/e3488256b4
Co-Authored-By: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|
When mmap fails for any reason, the fd must be closed.
Coverity Scan found this issue.
https://github.com/ruby/prism/commit/c06e9c400f
|
|
It looks like we can possibly do an out of bounds read if size is equal
to 0. This commit adds a conditional to ensure size is actually greater
than 0 before looking backwards in the buffer
https://github.com/ruby/prism/commit/2031b626e6
|
|
https://github.com/ruby/prism/commit/4ed7de537b
|
|
https://github.com/ruby/prism/commit/d68ea29d04
Notes:
Merged: https://github.com/ruby/ruby/pull/11497
|
|
https://github.com/ruby/prism/commit/487f0ffe78
|
|
https://github.com/ruby/prism/commit/31154a389a
|
|
|
|
https://github.com/ruby/prism/commit/89c22f0e6c
|
|
memory-mapped files
> ..., and on other POSIX systems we'll use `read`.
As `pm_string_mapped_init`'s doc comment says, it should fall back to
`read(2)`-based implementation on platforms without memory-mapped files
like WASI, but it didn't. This commit fixes it by calling `pm_string_file_init`
in the fallback case.
Also `defined(_POSIX_MAPPED_FILES)` check for `read(2)`-based path is
unnecessary, and it prevents the fallback from being executed, so this
change removes it.
https://github.com/ruby/prism/commit/b3d9064b71
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11196
|
|
|
|
https://github.com/ruby/prism/commit/36c6851c85
|
|
https://github.com/ruby/prism/commit/d13a05252d
|
|
https://github.com/ruby/prism/commit/283938ed1f
|
|
https://github.com/ruby/prism/commit/14e397598b
|
|
https://github.com/ruby/prism/commit/486c71c426
|
|
This eliminates the subnode on RationalNode and replaces it with two
integer fields, which represent the ratio for the rational. It also
reduces those two integers if they both fit into 32 bits.
Importantly, this PR does not implement bignum reduction. That's something
I'd like to consider for the future, but it's simple enough for now to
leave them unreduced, which makes it more useful than it used to be.
https://github.com/ruby/prism/commit/86e06c7068
|
|
https://github.com/ruby/prism/commit/2a43b4f55c
|
|
karatsuba_multiply
https://github.com/ruby/prism/commit/4dc6ea960d
|
|
|
|
https://github.com/ruby/prism/commit/f9a1abbc64
|
|
https://github.com/ruby/prism/commit/259aef2acd
|
|
https://github.com/ruby/prism/commit/c977c4c98a
|
|
https://github.com/ruby/prism/commit/f38946021e
|
|
https://github.com/ruby/prism/commit/020756fb11
|
|
https://github.com/ruby/prism/commit/2068e3c30a
|
|
Fixes https://github.com/ruby/prism/pull/2617.
There was an issue with the lexer as follows.
The following are valid regexp options:
```console
$ bundle exec ruby -Ilib -rprism -ve 'p Prism.lex("/x/io").value.map {|token| token[0].type }'
ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22]
[:REGEXP_BEGIN, :STRING_CONTENT, :REGEXP_END, :EOF]
```
The following are invalid regexp options. Unnecessary the `IDENTIFIER` token is appearing:
```console
$ bundle exec ruby -Ilib -rprism -ve 'p Prism.lex("/x/az").value.map {|token| token[0].type }'
ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22]
[:REGEXP_BEGIN, :STRING_CONTENT, :REGEXP_END, :IDENTIFIER, :EOF]
```
As a behavior of Ruby, when given `A` to `Z` and `a` to `z`, they act as invalid regexp options. e.g.,
```console
$ ruby -e '/regexp/az'
-e:1: unknown regexp options - az
/regexp/az
-e: compile error (SyntaxError)
```
Thus, it should probably not be construed as `IDENTIFIER` token.
Therefore, `pm_byte_table` has been adapted to accept those invalid regexp option values.
Whether it is a valid regexp option or not is checked by `pm_regular_expression_flags_create`.
For invalid regexp options, `PM_ERR_REGEXP_UNKNOWN_OPTIONS` is added to diagnostics.
https://github.com/ruby/prism/commit/d2a6096fcf
|
|
|
|
https://github.com/ruby/prism/commit/64c4f1268b
|
|
|
|
https://github.com/ruby/prism/commit/4913d112da
|
|
https://github.com/ruby/prism/commit/c3fcb5031f
|
|
https://github.com/ruby/prism/commit/afac2d6646
|
|
https://github.com/ruby/prism/commit/a2594a23c1
|
|
https://github.com/ruby/prism/commit/97f838c323
|
|
https://github.com/ruby/prism/commit/588acf823f
|
|
https://github.com/ruby/prism/commit/ae4fb6b988
|
|
https://github.com/ruby/prism/commit/62d4376a53
|
|
Signed-off-by: cui fliter <imcusg@gmail.com>
|
|
https://github.com/ruby/prism/commit/08733438bd
|
|
- Add `x` prefix to malloc, calloc, realloc, and free
(eg: malloc -> xmalloc)
- By default, they are replaced with stdlib's functions at build
- You can use custom functions by defining `PRISM_CUSTOM_ALLOCATOR` macro
https://github.com/ruby/prism/commit/7a878af619
|
|
https://github.com/ruby/prism/commit/fa9a30ad91
|
|
https://github.com/ruby/prism/commit/377666a5df
|
|
https://github.com/ruby/prism/commit/865b0d5fbe
|
|
https://github.com/ruby/prism/commit/3e10c46c14
|
|
https://github.com/ruby/prism/commit/9137226a52
|
|
|