diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-28 03:46:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-28 03:46:48 +0000 |
commit | b3507bf147ff47e331da36ba7c8e6b700c513633 (patch) | |
tree | 770b00214cf732211f90c050146890e6e99b5a87 /lib | |
parent | 978290515ea32204ff4b4173d6283050d628bd37 (diff) | |
download | ruby-b3507bf147ff47e331da36ba7c8e6b700c513633.tar.gz |
erb.rb: prohibit marshaling [EXPERIMENTAL]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/erb.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/erb.rb b/lib/erb.rb index 2adc5e0e58..df9a1e910d 100644 --- a/lib/erb.rb +++ b/lib/erb.rb @@ -833,6 +833,7 @@ class ERB @src, @encoding, @frozen_string = *compiler.compile(str) @filename = nil @lineno = 0 + @_init = self.class.singleton_class end NOT_GIVEN = Object.new private_constant :NOT_GIVEN @@ -891,6 +892,9 @@ class ERB # code evaluation. # def result(b=new_toplevel) + unless @_init.equal?(self.class.singleton_class) + raise ArgumentError, "not initialized" + end if @safe_level proc do prev_safe_level = $SAFE |