Repository navigation
Commit 459be8b
committed
fix(lsp): build empty cross-registries for zero-def corpora
cbm_arena_alloc(arena, 0) returns NULL, so the java and cs cross-registry
builders read a def_count of 0 as OOM and returned NULL — a corpus with no
files of that language silently lost its shared registry (and the seal tests
caught exactly that: cbm_cs_build_cross_registry(&arena, NULL, 0) == NULL).
Guard the partition alloc behind def_count > 0; the empty registry is still
built, finalized, and shared.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>1 parent ec16764 commit 459be8b
2 files changed
Lines changed: 18 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3714 | 3714 | | |
3715 | 3715 | | |
3716 | 3716 | | |
3717 | | - | |
3718 | | - | |
3719 | | - | |
| 3717 | + | |
| 3718 | + | |
| 3719 | + | |
| 3720 | + | |
| 3721 | + | |
| 3722 | + | |
| 3723 | + | |
| 3724 | + | |
| 3725 | + | |
3720 | 3726 | | |
3721 | 3727 | | |
3722 | 3728 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3846 | 3846 | | |
3847 | 3847 | | |
3848 | 3848 | | |
3849 | | - | |
3850 | | - | |
3851 | | - | |
| 3849 | + | |
| 3850 | + | |
| 3851 | + | |
| 3852 | + | |
| 3853 | + | |
| 3854 | + | |
| 3855 | + | |
| 3856 | + | |
| 3857 | + | |
3852 | 3858 | | |
3853 | 3859 | | |
3854 | 3860 | | |
| |||
0 commit comments