[#65451] [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string — ko1@...
Issue #10333 has been updated by Koichi Sasada.
ko1@atdot.net wrote:
Eric Wong <normalperson@yhbt.net> wrote:
Eric Wong <normalperson@yhbt.net> wrote:
On 2014/10/09 11:04, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
[#65453] [ruby-trunk - Feature #10328] [PATCH] make OPT_SUPPORT_JOKE a proper VM option — ko1@...
Issue #10328 has been updated by Koichi Sasada.
[#65559] is there a name for this? — Xavier Noria <fxn@...>
When describing stuff about constants (working in their guide), you often
On 2014/10/09 20:41, Xavier Noria wrote:
On Thu, Oct 9, 2014 at 1:59 PM, Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
[#65566] [ruby-trunk - Feature #10351] [Open] [PATCH] prevent CVE-2014-6277 — shyouhei@...
Issue #10351 has been reported by Shyouhei Urabe.
[#65741] Re: [ruby-cvs:55121] normal:r47971 (trunk): test/ruby/test_rubyoptions.rb: fix race — Nobuyoshi Nakada <nobu@...>
On 2014/10/16 10:10, normal@ruby-lang.org wrote:
Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
2014-10-16 12:48 GMT+09:00 Eric Wong <normalperson@yhbt.net>:
[#65753] [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string — ko1@...
Issue #10333 has been updated by Koichi Sasada.
[#65818] [ruby-trunk - Feature #10351] [PATCH] prevent CVE-2014-6277 — shyouhei@...
Issue #10351 has been updated by Shyouhei Urabe.
[ruby-core:65557] [ruby-trunk - Feature #8543] rb_iseq_load
Issue #8543 has been updated by Eric Wong.
billk@cts.com wrote:
> Sorry to be the squeaky wheel, but I was wondering if there still
> might be a chance to look into this before 2.2 is released?
Not speaking for the rest of ruby-core, but I welcome occasional
reminders like these :)
> I attempted a `git bisect` this evening in the hope of narrowing
> down where the iseq.load problems began -- however I ran into a
> problem of being unable to build ruby-trunk prior to this patch:
>
> commit 434826c0e9d3e3b48d99a39b7ad7626a6f1ae2eb
> Author: kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
> Date: Wed Jul 31 13:01:57 2013 +0000
>
> * parse.y: fix build error with bison-3.0.
>
> And unfortunately the iseq.load problem already existed by that
> point.
Thanks for that data point, it was before I started mucking with iseq.
Can you try installing/running an older bison?
> (I wonder how best to proceed with the bisect. I suppose one
> could write a script to attempt to apply the parse.y patch at
> each stage...)
Yes. "git bisect run" is awesome for scripting these things.
----------------------------------------
Feature #8543: rb_iseq_load
https://bugs.ruby-lang.org/issues/8543#change-49317
* Author: Alexey Voskov
* Status: Open
* Priority: Low
* Assignee: Koichi Sasada
* Category: YARV
* Target version: current: 2.2.0
----------------------------------------
I noticed an unusual behaviour of undocumented rb_iseq_load function.
Its work differs in different Ruby versions. I'm trying to protect some Ruby
source code by its conversion to YARV p-code and using the next strategy:
1. Convert code to array
~~~ruby
data = RubyVM::InstructionSequence.compile_file('hello.rb').to_a
~~~
2. Pass a compiled source to the rb_iseq_load function and evaluate it
~~~ruby
iseq = iseq_load.(data)
iseq.eval
~~~
Sample programs are supplied in the attachments.
"hello.rb"
```ruby
puts "tralivali"
def funct(a,b)
a**b
end
3.times { |i|
puts "Hello, world#{funct(2,i)}!"
}
```
The differences
Ruby 1.9.3 (ruby 1.9.3p194 (2012-04-20) [i386-mingw32])
Correct work. Output:
```
tralivali
Hello, world1!
Hello, world2!
Hello, world4!
```
Ruby 2.0.0 (ruby 2.0.0p193 (2013-05-14) [x64-mingw32])
Incorrect work (omits the code inside code blocks). Output
```
tralivali
```
Attempts of loading bigger programs by means of rb_iseq_load in Ruby 2.0.0 usually ends with a segmentation fault.
Such behaviour also can be reproduced by means of iseq Ruby extension ("for iseq freaks")
https://github.com/wanabe/iseq
P.S. I understand that it is an undocumented feature.
---Files--------------------------------
hello.rb (102 Bytes)
rb_pack.rb (931 Bytes)
iseq-load-test3.rb (210 Bytes)
iseq-load-test3-file.rb (369 Bytes)
please-fix-rb_iseq_load-thank-you.pdf (444 KB)
--
https://bugs.ruby-lang.org/