Repository navigation
Commit a414c3d
Raise a jitted cppia exception at the boundary back to native code
Jitted cppia does not throw. ThrowExpr::genCode writes the value to ctx->exception and
jumps to the function epilogue, and jitted code checks the context after every call it
makes to other jitted code, so within jitted code the unwind is complete.
Nothing did that where jitted code returns to native code. runFunction and
runFunctionClosure call compiled(ctx) and never look at ctx->exception, and the compiled
branch of CppiaClosure::__run looks only to decide against reading a return value, then
answers null() with the exception still set. The caller reads null, and since nothing
clears the context, every later call into jitted cppia returns at its first
checkException.
All three sites now raise it and clear the context, which is the shape TryExpr::runVoid
already uses on the interpreted path.
The cppia test suite covers it, run with -jit.
HaxeFoundation/hxcpp#1368
Fixes #661 parent d1d7d83 commit a414c3d
4 files changed
Lines changed: 54 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
226 | 227 | | |
227 | 228 | | |
228 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
514 | 514 | | |
515 | 515 | | |
516 | 516 | | |
| 517 | + | |
517 | 518 | | |
518 | 519 | | |
519 | 520 | | |
520 | 521 | | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
521 | 529 | | |
522 | 530 | | |
523 | 531 | | |
| |||
553 | 561 | | |
554 | 562 | | |
555 | 563 | | |
| 564 | + | |
556 | 565 | | |
557 | 566 | | |
558 | 567 | | |
559 | 568 | | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
560 | 576 | | |
561 | 577 | | |
562 | 578 | | |
| |||
759 | 775 | | |
760 | 776 | | |
761 | 777 | | |
762 | | - | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
763 | 785 | | |
764 | 786 | | |
765 | 787 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
17 | 28 | | |
18 | 29 | | |
19 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
223 | 242 | | |
224 | 243 | | |
225 | 244 | | |
| |||
0 commit comments