* tool/instruction.rb (make_header_prepare_stack): check stack
overflow. [ruby-core:25714] * tool/instruction.rb (make_footer_stack_val): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
92304aa3cd
commit
a97e80ba74
@ -1,3 +1,11 @@
|
|||||||
|
Wed Sep 23 11:28:06 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* tool/instruction.rb (make_header_prepare_stack): check stack
|
||||||
|
overflow. [ruby-core:25714]
|
||||||
|
|
||||||
|
* tool/instruction.rb (make_footer_stack_val): ditto.
|
||||||
|
|
||||||
|
|
||||||
Wed Sep 23 05:03:36 2009 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
Wed Sep 23 05:03:36 2009 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
||||||
|
|
||||||
* proc.c (umethod_bind, rb_mod_define_method): Fix bug that
|
* proc.c (umethod_bind, rb_mod_define_method): Fix bug that
|
||||||
|
@ -308,3 +308,14 @@ assert_equal "[:x]", %q{
|
|||||||
binding
|
binding
|
||||||
end
|
end
|
||||||
}, '[ruby-core:25125]'
|
}, '[ruby-core:25125]'
|
||||||
|
|
||||||
|
assert_normal_exit %q{
|
||||||
|
hash = {}
|
||||||
|
("aaaa".."matz").each_with_index do |s, i|
|
||||||
|
hash[s] = i
|
||||||
|
end
|
||||||
|
begin
|
||||||
|
eval "class C; @@h = #{hash.inspect}; end"
|
||||||
|
rescue SystemStackError
|
||||||
|
end
|
||||||
|
}, '[ruby-core:25714]'
|
||||||
|
@ -684,6 +684,9 @@ class RubyVM
|
|||||||
push_ba = insn.pushsc
|
push_ba = insn.pushsc
|
||||||
raise "unsupport" if push_ba[0].size > 0 && push_ba[1].size > 0
|
raise "unsupport" if push_ba[0].size > 0 && push_ba[1].size > 0
|
||||||
|
|
||||||
|
n = 0
|
||||||
|
push_ba.each {|pushs| n += pushs.length}
|
||||||
|
commit " CHECK_STACK_OVERFLOW(REG_CFP, #{n});" if n > 0
|
||||||
push_ba.each{|pushs|
|
push_ba.each{|pushs|
|
||||||
pushs.each{|r|
|
pushs.each{|r|
|
||||||
commit " PUSH(SCREG(#{r}));"
|
commit " PUSH(SCREG(#{r}));"
|
||||||
@ -816,13 +819,22 @@ class RubyVM
|
|||||||
commit " #define LABEL_IS_SC(lab) LABEL_##lab##_###{insn.sc.size == 0 ? 't' : 'f'}"
|
commit " #define LABEL_IS_SC(lab) LABEL_##lab##_###{insn.sc.size == 0 ? 't' : 'f'}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def each_footer_stack_val insn
|
||||||
|
insn.rets.reverse_each{|v|
|
||||||
|
break if v[1] == '...'
|
||||||
|
yield v
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
def make_footer_stack_val insn
|
def make_footer_stack_val insn
|
||||||
comment " /* push stack val */"
|
comment " /* push stack val */"
|
||||||
|
|
||||||
insn.rets.reverse_each{|v|
|
n = 0
|
||||||
if v[1] == '...'
|
each_footer_stack_val(insn){|v|
|
||||||
break
|
n += 1 unless v[2]
|
||||||
end
|
}
|
||||||
|
commit " CHECK_STACK_OVERFLOW(REG_CFP, #{n});" if n > 0
|
||||||
|
each_footer_stack_val(insn){|v|
|
||||||
if v[2]
|
if v[2]
|
||||||
commit " SCREG(#{v[2]}) = #{v[1]};"
|
commit " SCREG(#{v[2]}) = #{v[1]};"
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user