Commit 626e8fe
authored
fix(printer.rs): include ZeroSized FnDef consts in functions (#112)
- Problem: stable-mir-json misses function items (FnDef) that appear as
ConstantKind::ZeroSized when passed as values (e.g.
Option::map(u64::from_le_bytes)), so the emitted functions list is
incomplete.
- Fix: In InternedValueCollector::visit_mir_const, detect ZeroSized
constants whose type is FnDef, resolve an Instance (prefer
resolve_for_fn_ptr, fallback to resolve), and add it to the link map
with ItemSource(FPTR) so it is emitted in functions.
- Robustness: Avoid panicking on inconsistent symbol mappings by
skipping insertion when the existing LinkMapKey already maps to a
different symbol (direct-call vs reify shim cases).
- Related: #55 (and downstream
runtimeverification/mir-semantics#891
runtimeverification/mir-semantics#488).1 parent 20a1bbd commit 626e8fe
File tree
31 files changed
+9581
-4090
lines changed- src
- tests/integration
- programs
31 files changed
+9581
-4090
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
603 | 607 | | |
604 | 608 | | |
605 | 609 | | |
| |||
609 | 613 | | |
610 | 614 | | |
611 | 615 | | |
612 | | - | |
| 616 | + | |
613 | 617 | | |
614 | 618 | | |
615 | 619 | | |
616 | 620 | | |
617 | 621 | | |
618 | 622 | | |
619 | 623 | | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
620 | 636 | | |
621 | 637 | | |
622 | 638 | | |
| |||
898 | 914 | | |
899 | 915 | | |
900 | 916 | | |
901 | | - | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
902 | 938 | | |
903 | 939 | | |
904 | 940 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
0 commit comments