Commit 7d8a415
committed
check break target correctly.
* compile.c (iseq_compile_each0): save target child_iseq in the catch-table
for break. This iseq is not for continuation, but for search key at
vm_throw_start().
* vm_insnhelper.c (vm_throw_start): check saved iseq first.
* iseq.h: add comment for it.
* test/ruby/test_iterator.rb (test_ljump): add a test for the issue:
def call b; b.call; end
call(Proc.new{break}){} #=> (1) should raise LocalJumpError
call(Proc.new{break}) #=> (2) shoudd raies LocalJumpError, too.
but (1) doesn't raise LocalJumpError.
This issue is reported by Matz.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e1 parent 0318de2 commit 7d8a415
4 files changed
+28
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4399 | 4399 | | |
4400 | 4400 | | |
4401 | 4401 | | |
| 4402 | + | |
4402 | 4403 | | |
4403 | 4404 | | |
4404 | 4405 | | |
4405 | 4406 | | |
4406 | 4407 | | |
4407 | | - | |
| 4408 | + | |
| 4409 | + | |
4408 | 4410 | | |
4409 | | - | |
| 4411 | + | |
4410 | 4412 | | |
4411 | 4413 | | |
4412 | | - | |
| 4414 | + | |
| 4415 | + | |
4413 | 4416 | | |
4414 | 4417 | | |
4415 | 4418 | | |
| |||
4421 | 4424 | | |
4422 | 4425 | | |
4423 | 4426 | | |
4424 | | - | |
| 4427 | + | |
4425 | 4428 | | |
4426 | 4429 | | |
4427 | 4430 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
154 | 167 | | |
| 168 | + | |
155 | 169 | | |
156 | 170 | | |
157 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
282 | 285 | | |
283 | 286 | | |
284 | 287 | | |
| |||
300 | 303 | | |
301 | 304 | | |
302 | 305 | | |
| 306 | + | |
303 | 307 | | |
304 | 308 | | |
305 | 309 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1090 | 1090 | | |
1091 | 1091 | | |
1092 | 1092 | | |
1093 | | - | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
1094 | 1096 | | |
1095 | 1097 | | |
1096 | 1098 | | |
| |||
0 commit comments