From 717e83ef9c857176ce223087951833a24aa59f7e Mon Sep 17 00:00:00 2001 From: KyleMiles Date: Thu, 12 Aug 2021 16:49:46 -0400 Subject: Rust API : DebugInfo API Fixes --- rust/src/types.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'rust/src/types.rs') diff --git a/rust/src/types.rs b/rust/src/types.rs index 0884d9ac..45ea6d7d 100644 --- a/rust/src/types.rs +++ b/rust/src/types.rs @@ -773,9 +773,9 @@ impl Type { let mut stack_adjust = Conf::::new(0, min_confidence()).into(); let mut raw_parameters = Vec::::with_capacity(parameters.len()); + let mut parameter_name_references = Vec::with_capacity(parameters.len()); for parameter in parameters { - let raw_name = parameter.name.as_bytes_with_nul(); - + let raw_name = parameter.name.clone().as_bytes_with_nul(); let location = match ¶meter.location { Some(location) => location.into_raw(), None => unsafe { mem::zeroed() }, @@ -788,6 +788,7 @@ impl Type { defaultLocation: parameter.location.is_none(), location, }); + parameter_name_references.push(raw_name); } unsafe { @@ -821,9 +822,9 @@ impl Type { let mut stack_adjust = stack_adjust.into(); let mut raw_parameters = Vec::::with_capacity(parameters.len()); + let mut parameter_name_references = Vec::with_capacity(parameters.len()); for parameter in parameters { let raw_name = parameter.name.as_bytes_with_nul(); - let location = match ¶meter.location { Some(location) => location.into_raw(), None => unsafe { mem::zeroed() }, @@ -836,6 +837,7 @@ impl Type { defaultLocation: parameter.location.is_none(), location, }); + parameter_name_references.push(raw_name); } unsafe { -- cgit v1.3.1