From ae99355c1dca2067a5b5d5595b7295c3aca2dbd8 Mon Sep 17 00:00:00 2001 From: Nikita Smith Date: Wed, 15 Apr 2026 15:10:22 -0700 Subject: [PATCH] shift upper type index bound --- src/linker/codeview_ext/codeview.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/linker/codeview_ext/codeview.c b/src/linker/codeview_ext/codeview.c index 235d0b45..74e7938f 100644 --- a/src/linker/codeview_ext/codeview.c +++ b/src/linker/codeview_ext/codeview.c @@ -1137,6 +1137,13 @@ store_stop: for EachElement(i, debug_t.ti_ranges) { debug_t.ti_ranges[i] = r1u64(CV_MinComplexTypeIndex, CV_MinComplexTypeIndex + debug_t.count); } + // shift upper type index bound to include precompiled types + CV_Leaf leaf = cv_debug_t_get_leaf(&debug_t, 0); + if (leaf.kind == CV_LeafKind_PRECOMP) { + CV_PrecompInfo precomp_info = cv_precomp_info_from_leaf(leaf); + for EachElement(i, debug_t.ti_ranges) { debug_t.ti_ranges[i].max += precomp_info.leaf_count; } + } + ProfEnd(); return debug_t; }