[#101179] Spectre Mitigations — Amel <amel.smajic@...>
Hi there!
5 messages
2020/12/01
[#101180] Re: Spectre Mitigations
— Chris Seaton <chris@...>
2020/12/01
I wouldn’t recommend using Ruby to run in-process untrusted code in the first place. Are people doing that?
[#101694] Ruby 3.0.0 Released — "NARUSE, Yui" <naruse@...>
We are pleased to announce the release of Ruby 3.0.0. From 2015 we
4 messages
2020/12/25
[ruby-core:101449] [Ruby master Bug#17345] ripper: nothing raised when assigning to keyword variables
From:
nov@...
Date:
2020-12-14 17:18:21 UTC
List:
ruby-core #101449
Issue #17345 has been updated by no6v (Nobuhiro IMAI).
no6v (Nobuhiro IMAI) wrote in #note-2:
> Thanks for the quick fix, however `*_error` parser events except `parse_error` seem not to set an error message properly.
>
> ```
> $ ruby -rripper -ve 'Ripper.lex("nil=1", raise_errors: true)'
> ruby 3.0.0dev (2020-11-26T11:14:34Z master f5ca3ff4db) [x86_64-linux]
> /home/nov/.rvm/rubies/ruby-head/lib/ruby/3.0.0/ripper/lexer.rb:134:in `parse': #<struct Ripper::Lexer::Elem pos=[1, 0], event=:on_kw, tok="nil", state=END, message=nil> ;#<struct Ripper::Lexer::Elem pos=[1, 3], event=:on_op, tok="=", state=BEG, message=nil> ;#<struct Ripper::Lexer::Elem pos=[1, 4], event=:on_int, tok="1", state=END, message=nil> (SyntaxError)
> ```
Won't to fix this?
This breaks `irb --colorize` which uses `Ripper::Lexer#scan` and which expects `Ripper::Lexer::Elem#message` to return a string.
https://github.com/ruby/ruby/blob/master/lib/irb/color.rb#L161-L163
While typing `nil=`, the following exception raises immediately on pressing `=` key.
```
$ docker run --rm -it rubylang/all-ruby:latest ./bin/ruby-3.0.0-preview2 -rirb -eIRB.start
irb(main):001:0> nil/build-all-ruby/3.0.0-preview2/lib/ruby/3.0.0/irb/color.rb:163:in `block (2 levels) in scan': no implicit conversion of Array into String (TypeError)
...
```
----------------------------------------
Bug #17345: ripper: nothing raised when assigning to keyword variables
https://bugs.ruby-lang.org/issues/17345#change-89219
* Author: no6v (Nobuhiro IMAI)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 3.0.0dev (2020-11-25T04:36:39Z master 00f046ef57) [x86_64-linux]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
```ruby
require "ripper"
Ripper.tokenize("retry=1", raise_errors: true)
# => SyntaxError (syntax error, unexpected '=', expecting end-of-input)
Ripper.tokenize("nil=1", raise_errors: true) # => ["nil", "=", "1"]
lexer = Ripper::Lexer.new("nil=1")
lexer.tokenize # => ["nil", "=", "1"]
lexer.error? # => true
lexer.errors # => []
```
Lexer recognizes there was an error, but nothing is set to `errors`.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>