Mercurial > hg > Members > anatofuz > MoarVM
changeset 34:0853778b49ee
fix insert cbc_next(i) for throw code sgemtns
author | Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 13 Nov 2018 17:54:28 +0900 |
parents | a5f4b3f1c5d1 |
children | 29dd3807070e |
files | cbctools/change_OP_to_cbc.pl |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/cbctools/change_OP_to_cbc.pl Tue Nov 13 17:44:43 2018 +0900 +++ b/cbctools/change_OP_to_cbc.pl Tue Nov 13 17:54:28 2018 +0900 @@ -79,6 +79,7 @@ # 例外だったらかえってこないはずなのでgoto if ( $cbc_lines[$i] =~ /MVM_exception_throw_adhoc/ && $cbc_lines[$i+1] =~ /OP\(/){ push @rewritec, change_i($cbc_lines[$i]); + insert_cbc_next(); insert_right_blanket(); next; } @@ -111,11 +112,16 @@ $str =~ s/cur_op/i->cur_op/g; $str =~ s/tc/i->tc/g; $str =~ s/cur_callsite/i->cur_callsite/g; - $str =~ s/NEXT;/NEXT(i);/; + $str =~ s/NEXT;/cbc_next(i);/; $str =~ s/ / /g; return $str; } +sub insert_cbc_next{ + #push @rewritec,"$indent}\n"; + push @rewritec," goto cbc_next(i);\n"; +} + sub insert_right_blanket { #push @rewritec,"$indent}\n"; push @rewritec,"}\n";