Commit dce728e
committed
pulley: trap on null in 8 fused funcref-dispatch handlers
Codex review on the rebeckerspecialties wasmtime fork PR pointed out
that phase-2/3's continuation-block load absorption breaks the
lazy-init slow path's correctness: the slow path's libcall rejoins
`continuation_block` via a block param, and after absorption the
loads are gone — `call_indirect` would see uninitialized
`dst_code`/`dst_vmctx` if the slow path is ever reached.
Fusion is gated on `is_eagerly_initialized_funcref_table` so the
slow path is unreachable at runtime, but the previous handler's
`ControlFlow::Continue(())` on null was advertised as defence-in-
depth and was itself broken. Replace it with `done_trap` in the 8
affected handlers (4 forward + 4 `_not` variants across x64/x32 ×
xfuncref_dispatch/xband_funcref_dispatch). `offset` on the `_not`
variants becomes vestigial; kept for encoding-shape parity.1 parent 1318256 commit dce728e
14 files changed
Lines changed: 663 additions & 435 deletions
File tree
- pulley/src
- tests
- all
- disas
- pulley
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
410 | | - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
411 | 415 | | |
412 | 416 | | |
413 | 417 | | |
414 | 418 | | |
415 | | - | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
416 | 424 | | |
417 | 425 | | |
418 | 426 | | |
| |||
422 | 430 | | |
423 | 431 | | |
424 | 432 | | |
425 | | - | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
426 | 438 | | |
427 | 439 | | |
428 | 440 | | |
429 | 441 | | |
430 | | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
431 | 447 | | |
432 | 448 | | |
433 | 449 | | |
| |||
482 | 498 | | |
483 | 499 | | |
484 | 500 | | |
485 | | - | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
486 | 508 | | |
487 | 509 | | |
488 | 510 | | |
489 | 511 | | |
490 | | - | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
491 | 519 | | |
492 | 520 | | |
493 | 521 | | |
| |||
497 | 525 | | |
498 | 526 | | |
499 | 527 | | |
500 | | - | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
501 | 535 | | |
502 | 536 | | |
503 | 537 | | |
504 | 538 | | |
505 | | - | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
506 | 546 | | |
507 | 547 | | |
508 | 548 | | |
| |||
513 | 553 | | |
514 | 554 | | |
515 | 555 | | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
522 | 562 | | |
523 | 563 | | |
524 | 564 | | |
| |||
559 | 599 | | |
560 | 600 | | |
561 | 601 | | |
562 | | - | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
563 | 610 | | |
564 | 611 | | |
565 | 612 | | |
566 | 613 | | |
567 | | - | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
568 | 622 | | |
569 | 623 | | |
570 | 624 | | |
| |||
574 | 628 | | |
575 | 629 | | |
576 | 630 | | |
577 | | - | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
578 | 639 | | |
579 | 640 | | |
580 | 641 | | |
581 | 642 | | |
582 | | - | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
583 | 651 | | |
584 | 652 | | |
585 | 653 | | |
| |||
589 | 657 | | |
590 | 658 | | |
591 | 659 | | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
598 | 666 | | |
599 | 667 | | |
600 | 668 | | |
| |||
0 commit comments