fix(debuginfo): avoid overflow when handling expanding recursive type

This commit is contained in:
Adwin White
2025-03-17 18:17:09 +08:00
parent 0e76f8b7e0
commit 8e235258f3
3 changed files with 66 additions and 1 deletions

View File

@@ -65,6 +65,7 @@ pub(crate) struct CodegenUnitDebugContext<'ll, 'tcx> {
created_files: RefCell<UnordMap<Option<(StableSourceFileId, SourceFileHash)>, &'ll DIFile>>,
type_map: metadata::TypeMap<'ll, 'tcx>,
adt_stack: RefCell<Vec<(DefId, GenericArgsRef<'tcx>)>>,
namespace_map: RefCell<DefIdMap<&'ll DIScope>>,
recursion_marker_type: OnceCell<&'ll DIType>,
}
@@ -79,6 +80,7 @@ impl<'ll, 'tcx> CodegenUnitDebugContext<'ll, 'tcx> {
builder,
created_files: Default::default(),
type_map: Default::default(),
adt_stack: Default::default(),
namespace_map: RefCell::new(Default::default()),
recursion_marker_type: OnceCell::new(),
}