1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* eval.c (proc_save_safe_level): no need to restrict safe level

memoize in $SAFE>=3.  [ruby-dev:27050]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2005-09-12 16:21:50 +00:00
parent 35a84adff0
commit 82e8e747df
5 changed files with 14 additions and 12 deletions

View file

@ -1,3 +1,8 @@
Tue Sep 13 01:17:45 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (proc_save_safe_level): no need to restrict safe level
memoize in $SAFE>=3. [ruby-dev:27050]
Tue Sep 13 00:02:33 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (apply2files): stricter callback definition.

8
eval.c
View file

@ -7968,11 +7968,9 @@ bind_eval(int argc, VALUE *argv, VALUE bind)
static void
proc_save_safe_level(VALUE data)
{
if (ruby_safe_level >= 3) {
int safe = ruby_safe_level;
if (safe > PROC_TMAX) safe = PROC_TMAX;
FL_SET(data, (safe << PROC_TSHIFT) & PROC_TMASK);
}
int safe = ruby_safe_level;
if (safe > PROC_TMAX) safe = PROC_TMAX;
FL_SET(data, (safe << PROC_TSHIFT) & PROC_TMASK);
}
static int

View file

@ -19,7 +19,7 @@ class TestBasicSocket < Test::Unit::TestCase
n = s.getsockopt(Socket::SOL_SOCKET, Socket::SO_ERROR)
assert_equal([0].pack("i"), n)
val = Object.new
class << val; self end.send(:define_method, :to_int) {
class << val; self end.fcall(:define_method, :to_int) {
s.close
Socket::SO_TYPE
}
@ -34,7 +34,7 @@ class TestBasicSocket < Test::Unit::TestCase
linger = [0, 0].pack("ii")
val = Object.new
class << val; self end.send(:define_method, :to_str) {
class << val; self end.fcall(:define_method, :to_str) {
s.close
linger
}
@ -47,7 +47,7 @@ class TestBasicSocket < Test::Unit::TestCase
end
val = Object.new
class << val; self end.send(:define_method, :to_int) {
class << val; self end.fcall(:define_method, :to_int) {
s.close
Socket::SO_LINGER
}
@ -61,7 +61,7 @@ class TestBasicSocket < Test::Unit::TestCase
def test_listen
s = nil
log = Object.new
class << log; self end.send(:define_method, :to_int) {
class << log; self end.fcall(:define_method, :to_int) {
s.close
2
}

View file

@ -9,7 +9,7 @@ class TestUDPSocket < Test::Unit::TestCase
def test_connect # [ruby-dev:25045]
s = UDPSocket.new
host = Object.new
class << host; self end.send(:define_method, :to_str) {
class << host; self end.fcall(:define_method, :to_str) {
s.close
"127.0.0.1"
}
@ -21,7 +21,7 @@ class TestUDPSocket < Test::Unit::TestCase
def test_bind # [ruby-dev:25057]
s = UDPSocket.new
host = Object.new
class << host; self end.send(:define_method, :to_str) {
class << host; self end.fcall(:define_method, :to_str) {
s.close
"127.0.0.1"
}

View file

@ -483,7 +483,6 @@ Message: <"Error">
def test_assert_send
object = Object.new
class << object
private
def return_argument(argument, bogus)
return argument
end