* 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
@ -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>
|
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
|
* 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;
|
break;
|
||||||
|
|
||||||
case NODE_MASGN:
|
case NODE_MASGN:
|
||||||
massign(self, lhs, svalue_to_avalue(val), pcall);
|
massign(self, lhs, svalue_to_mrhs(val, lhs->nd_head), pcall);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NODE_CALL:
|
case NODE_CALL:
|
||||||
|
14
lib/debug.rb
14
lib/debug.rb
@ -30,6 +30,7 @@ class Mutex
|
|||||||
end
|
end
|
||||||
|
|
||||||
def lock
|
def lock
|
||||||
|
return if Thread.critical
|
||||||
return if @locker == Thread.current
|
return if @locker == Thread.current
|
||||||
while (Thread.critical = true; @locked)
|
while (Thread.critical = true; @locked)
|
||||||
@waiting.push Thread.current
|
@waiting.push Thread.current
|
||||||
@ -42,6 +43,7 @@ class Mutex
|
|||||||
end
|
end
|
||||||
|
|
||||||
def unlock
|
def unlock
|
||||||
|
return if Thread.critical
|
||||||
return unless @locked
|
return unless @locked
|
||||||
unless @locker == Thread.current
|
unless @locker == Thread.current
|
||||||
raise RuntimeError, "unlocked by other"
|
raise RuntimeError, "unlocked by other"
|
||||||
@ -115,6 +117,7 @@ class Context
|
|||||||
end
|
end
|
||||||
|
|
||||||
def check_suspend
|
def check_suspend
|
||||||
|
return if Thread.critical
|
||||||
while (Thread.critical = true; @suspend_next)
|
while (Thread.critical = true; @suspend_next)
|
||||||
DEBUGGER__.waiting.push Thread.current
|
DEBUGGER__.waiting.push Thread.current
|
||||||
@suspend_next = false
|
@suspend_next = false
|
||||||
@ -775,12 +778,13 @@ class << DEBUGGER__
|
|||||||
end
|
end
|
||||||
|
|
||||||
def set_trace( arg )
|
def set_trace( arg )
|
||||||
|
saved_crit = Thread.critical
|
||||||
Thread.critical = true
|
Thread.critical = true
|
||||||
make_thread_list
|
make_thread_list
|
||||||
for th in @thread_list
|
for th in @thread_list
|
||||||
context(th[0]).set_trace arg
|
context(th[0]).set_trace arg
|
||||||
end
|
end
|
||||||
Thread.critical = false
|
Thread.critical = saved_crit
|
||||||
arg
|
arg
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -789,18 +793,20 @@ class << DEBUGGER__
|
|||||||
end
|
end
|
||||||
|
|
||||||
def suspend
|
def suspend
|
||||||
|
saved_crit = Thread.critical
|
||||||
Thread.critical = true
|
Thread.critical = true
|
||||||
make_thread_list
|
make_thread_list
|
||||||
for th in @thread_list
|
for th in @thread_list
|
||||||
next if th[0] == Thread.current
|
next if th[0] == Thread.current
|
||||||
context(th[0]).set_suspend
|
context(th[0]).set_suspend
|
||||||
end
|
end
|
||||||
Thread.critical = false
|
Thread.critical = saved_crit
|
||||||
# Schedule other threads to suspend as soon as possible.
|
# Schedule other threads to suspend as soon as possible.
|
||||||
Thread.pass
|
Thread.pass unless Thread.critical
|
||||||
end
|
end
|
||||||
|
|
||||||
def resume
|
def resume
|
||||||
|
saved_crit = Thread.critical
|
||||||
Thread.critical = true
|
Thread.critical = true
|
||||||
make_thread_list
|
make_thread_list
|
||||||
for th in @thread_list
|
for th in @thread_list
|
||||||
@ -811,7 +817,7 @@ class << DEBUGGER__
|
|||||||
th.run
|
th.run
|
||||||
end
|
end
|
||||||
waiting.clear
|
waiting.clear
|
||||||
Thread.critical = false
|
Thread.critical = saved_crit
|
||||||
# Schedule other threads to restart as soon as possible.
|
# Schedule other threads to restart as soon as possible.
|
||||||
Thread.pass
|
Thread.pass
|
||||||
end
|
end
|
||||||
|
@ -276,6 +276,13 @@ test_ok(a == 1)
|
|||||||
a,=*[[[1]]]
|
a,=*[[[1]]]
|
||||||
test_ok(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; end; test_ok(a == nil)
|
||||||
a = loop do break nil; 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)
|
a = loop do break 1; end; test_ok(a == 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user