--7AUc2qLy4jB3hD7Z
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 12, 2012 at 08:58:36AM +0900, zenspider (Ryan Davis) wrote:
>=20
> Issue #6724 has been reported by zenspider (Ryan Davis).
>=20
> ----------------------------------------
> Bug #6724: waaaaaaant! (
> https://bugs.ruby-lang.org/issues/6724
>=20
> Author: zenspider (Ryan Davis)
> Status: Open
> Priority: Normal
> Assignee: ko1 (Koichi Sasada)
> Category:=20
> Target version:=20
> ruby -v: 2.x
>=20
>=20
> GIMME GIMME GIMME! waaaaaant... We don't _need_ a verifier. User responsi=
bility... etc etc.
>=20
>=20
> Can I commit this??? PLEEEEEEASE???
>=20
> Index: iseq.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- iseq.c	(revision 36369)
> +++ iseq.c	(working copy)
> @@ -1585,9 +1585,7 @@
>      rb_define_method(rb_cISeq, "marshal_load", iseq_marshal_load, 1);
>  #endif
> =20
> -    /* disable this feature because there is no verifier. */
> -    /* rb_define_singleton_method(rb_cISeq, "load", iseq_s_load, -1); */
> -    (void)iseq_s_load;
> +    rb_define_singleton_method(rb_cISeq, "load", iseq_s_load, -1);
> =20
>      rb_define_singleton_method(rb_cISeq, "compile", iseq_s_compile, -1);
>      rb_define_singleton_method(rb_cISeq, "new", iseq_s_compile, -1);

    require 'dl'
    require 'fiddle'
    require 'minitest/autorun'
   =20
    class RubyVM
      class InstructionSequence
        address =3D DL::Handle::DEFAULT['rb_iseq_load']
        func =3D Fiddle::Function.new(address, [DL::TYPE_VOIDP] * 3, DL::TY=
PE_VOIDP)
   =20
        define_singleton_method(:load) do |data, parent =3D nil, opt =3D ni=
l|
          func.call(DL.dlwrap(data), parent, opt).to_value
        end
      end
    end
   =20
    class TestISeq < MiniTest::Unit::TestCase
      def test_load
        ins   =3D RubyVM::InstructionSequence.new '5 + 10'
        other =3D RubyVM::InstructionSequence.load ins.to_a
        assert_equal ins.eval, other.eval
      end
    end

<3<3<3<3

--=20
Aaron Patterson
http://tenderlovemaking.com/

--7AUc2qLy4jB3hD7Z
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (Darwin)

iQEcBAEBAgAGBQJQBdjBAAoJEJUxcLy0/6/GFeoH/3VIR0XDOi06BIwhInCWukRL
oLFoxpELhQEPx7A1IKRUa5Z3Ia/+pw1PYegwtPVkfNydwRoQdlJAKHjJDImjnYqA
Ene52z0pTjDUxLv/9Mc551IsNUg4CQYAt97q46Jxf0DuUvmXaxFkiLxS24HV0VUD
IO/rIMlP8j9hPZfccFnLx30GDD8VA8pRy+ph4wziT/SjF2nEZN8ne2AsY6HeoqSa
gc8EwCRM6cYd93Qu+7zty3hpTG6cUxuo4u/NJTXnP3KIie7JjQGk3aHSTpyigDMT
jB0A/aR1yHJ8JDUDX9WttQt8KnXyGrOSvQH22e6D3TQ8fImgDinL99AJGgZT6S4=
=HgHa
-----END PGP SIGNATURE-----

--7AUc2qLy4jB3hD7Z--

On Thu, Jul 12, 2012 at 08:58:36AM +0900, zenspider (Ryan Davis) wrote:
>=20
> Issue #6724 has been reported by zenspider (Ryan Davis).
>=20
> ----------------------------------------
> Bug #6724: waaaaaaant! (
> https://bugs.ruby-lang.org/issues/6724
>=20
> Author: zenspider (Ryan Davis)
> Status: Open
> Priority: Normal
> Assignee: ko1 (Koichi Sasada)
> Category:=20
> Target version:=20
> ruby -v: 2.x
>=20
>=20
> GIMME GIMME GIMME! waaaaaant... We don't _need_ a verifier. User responsi=
bility... etc etc.
>=20
>=20
> Can I commit this??? PLEEEEEEASE???
>=20
> Index: iseq.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- iseq.c	(revision 36369)
> +++ iseq.c	(working copy)
> @@ -1585,9 +1585,7 @@
>      rb_define_method(rb_cISeq, "marshal_load", iseq_marshal_load, 1);
>  #endif
> =20
> -    /* disable this feature because there is no verifier. */
> -    /* rb_define_singleton_method(rb_cISeq, "load", iseq_s_load, -1); */
> -    (void)iseq_s_load;
> +    rb_define_singleton_method(rb_cISeq, "load", iseq_s_load, -1);
> =20
>      rb_define_singleton_method(rb_cISeq, "compile", iseq_s_compile, -1);
>      rb_define_singleton_method(rb_cISeq, "new", iseq_s_compile, -1);

    require 'dl'
    require 'fiddle'
    require 'minitest/autorun'
   =20
    class RubyVM
      class InstructionSequence
        address =3D DL::Handle::DEFAULT['rb_iseq_load']
        func =3D Fiddle::Function.new(address, [DL::TYPE_VOIDP] * 3, DL::TY=
PE_VOIDP)
   =20
        define_singleton_method(:load) do |data, parent =3D nil, opt =3D ni=
l|
          func.call(DL.dlwrap(data), parent, opt).to_value
        end
      end
    end
   =20
    class TestISeq < MiniTest::Unit::TestCase
      def test_load
        ins   =3D RubyVM::InstructionSequence.new '5 + 10'
        other =3D RubyVM::InstructionSequence.load ins.to_a
        assert_equal ins.eval, other.eval
      end
    end

<3<3<3<3

--=20
Aaron Patterson
http://tenderlovemaking.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (Darwin)

iQEcBAEBAgAGBQJQBdjBAAoJEJUxcLy0/6/GFeoH/3VIR0XDOi06BIwhInCWukRL
oLFoxpELhQEPx7A1IKRUa5Z3Ia/+pw1PYegwtPVkfNydwRoQdlJAKHjJDImjnYqA
Ene52z0pTjDUxLv/9Mc551IsNUg4CQYAt97q46Jxf0DuUvmXaxFkiLxS24HV0VUD
IO/rIMlP8j9hPZfccFnLx30GDD8VA8pRy+ph4wziT/SjF2nEZN8ne2AsY6HeoqSa
gc8EwCRM6cYd93Qu+7zty3hpTG6cUxuo4u/NJTXnP3KIie7JjQGk3aHSTpyigDMT
jB0A/aR1yHJ8JDUDX9WttQt8KnXyGrOSvQH22e6D3TQ8fImgDinL99AJGgZT6S4=
=HgHa
-----END PGP SIGNATURE-----