summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-04-04 05:12:19 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-04-04 05:12:19 +0000
commit79557dcbb0198f3f33951835469e47734d0ffb6d (patch)
treeff756a754747d414cc8c81b81ca2f6aef3ea846b
parent75c2f3cbc5ebc106821f71adf43d2b0af0e38dc1 (diff)
* eval.c (assign): should prepare mrhs by svalue_to_mrhs().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--eval.c2
-rw-r--r--lib/debug.rb14
-rw-r--r--sample/test.rb7
4 files changed, 22 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 71ad3b0c6b..b66080cbde 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Fri Apr 4 10:53:22 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval.c (assign): should prepare mrhs by svalue_to_mrhs().
+
Wed Apr 02 15:11:23 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* README.EXT, README.EXT.ja (3.3): clarified -1 as free for
diff --git a/eval.c b/eval.c
index 8706984537..90f91408ad 100644
--- a/eval.c
+++ b/eval.c
@@ -4200,7 +4200,7 @@ assign(self, lhs, val, pcall)
break;
case NODE_MASGN:
- massign(self, lhs, svalue_to_avalue(val), pcall);
+ massign(self, lhs, svalue_to_mrhs(val, lhs->nd_head), pcall);
break;
case NODE_CALL:
diff --git a/lib/debug.rb b/lib/debug.rb
index 8f2999a3ab..ab32c9d023 100644
--- a/lib/debug.rb
+++ b/lib/debug.rb
@@ -30,6 +30,7 @@ class Mutex
end
def lock
+ return if Thread.critical
return if @locker == Thread.current
while (Thread.critical = true; @locked)
@waiting.push Thread.current
@@ -42,6 +43,7 @@ class Mutex
end
def unlock
+ return if Thread.critical
return unless @locked
unless @locker == Thread.current
raise RuntimeError, "unlocked by other"
@@ -115,6 +117,7 @@ class Context
end
def check_suspend
+ return if Thread.critical
while (Thread.critical = true; @suspend_next)
DEBUGGER__.waiting.push Thread.current
@suspend_next = false
@@ -775,12 +778,13 @@ class << DEBUGGER__
end
def set_trace( arg )
+ saved_crit = Thread.critical
Thread.critical = true
make_thread_list
for th in @thread_list
context(th[0]).set_trace arg
end
- Thread.critical = false
+ Thread.critical = saved_crit
arg
end
@@ -789,18 +793,20 @@ class << DEBUGGER__
end
def suspend
+ saved_crit = Thread.critical
Thread.critical = true
make_thread_list
for th in @thread_list
next if th[0] == Thread.current
context(th[0]).set_suspend
end
- Thread.critical = false
+ Thread.critical = saved_crit
# Schedule other threads to suspend as soon as possible.
- Thread.pass
+ Thread.pass unless Thread.critical
end
def resume
+ saved_crit = Thread.critical
Thread.critical = true
make_thread_list
for th in @thread_list
@@ -811,7 +817,7 @@ class << DEBUGGER__
th.run
end
waiting.clear
- Thread.critical = false
+ Thread.critical = saved_crit
# Schedule other threads to restart as soon as possible.
Thread.pass
end
diff --git a/sample/test.rb b/sample/test.rb
index 5c263090d0..3f9253b3ac 100644
--- a/sample/test.rb
+++ b/sample/test.rb
@@ -276,6 +276,13 @@ test_ok(a == 1)
a,=*[[[1]]]
test_ok(a == [1])
+x, (y, z) = 1, 2, 3
+test_ok([1,2,nil] == [x,y,z])
+x, (y, z) = 1, [2,3]
+test_ok([1,2,3] == [x,y,z])
+x, (y, z) = 1, [2]
+test_ok([1,2,nil] == [x,y,z])
+
a = loop do break; end; test_ok(a == nil)
a = loop do break nil; end; test_ok(a == nil)
a = loop do break 1; end; test_ok(a == 1)