From 7df5aa809b78c2ed3abc9f6bc3dae9e34b809d32 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Mon, 11 Nov 2024 14:27:21 -0500 Subject: WARP: Cache type references in the view caches This allows us to free the type references instead of keeping them around forever --- plugins/warp/src/bin/sigem.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'plugins/warp/src/bin') diff --git a/plugins/warp/src/bin/sigem.rs b/plugins/warp/src/bin/sigem.rs index 2da14639..d7f1f50b 100644 --- a/plugins/warp/src/bin/sigem.rs +++ b/plugins/warp/src/bin/sigem.rs @@ -103,10 +103,17 @@ fn data_from_view(view: &BinaryView) -> Data { Some(warp_ninja::cache::cached_function(&f, &llil)) }) .collect::>(); - data.types.extend(view.types().iter().map(|ty| { - let ref_ty = ty.type_object().to_owned(); - ComputedType::new(from_bn_type(view, &ref_ty, u8::MAX)) - })); + + if let Some(ref_ty_cache) = cached_type_references(view) { + let referenced_types = ref_ty_cache + .cache + .iter() + .filter_map(|t| t.to_owned()) + .collect::>(); + + data.types.extend(referenced_types); + } + data } -- cgit v1.3.1