mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
75c2f3cbc5
commit
79557dcbb0
4 changed files with 22 additions and 5 deletions
|
@ -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
|
||||
|
|
2
eval.c
2
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:
|
||||
|
|
14
lib/debug.rb
14
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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue