diff options
| author | KyleMiles <krm504@nyu.edu> | 2021-08-12 16:49:46 -0400 |
|---|---|---|
| committer | KyleMiles <krm504@nyu.edu> | 2021-08-18 12:51:06 -0400 |
| commit | 717e83ef9c857176ce223087951833a24aa59f7e (patch) | |
| tree | 449c5465f46f8762551f3ad5704bfb94fbdfc5f3 /rust/src/types.rs | |
| parent | a9bfea5e6b844f7129a5510176e85b274ccab795 (diff) | |
Rust API : DebugInfo API Fixes
Diffstat (limited to 'rust/src/types.rs')
| -rw-r--r-- | rust/src/types.rs | 8 |
1 files changed, 5 insertions, 3 deletions
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::<i64>::new(0, min_confidence()).into(); let mut raw_parameters = Vec::<BNFunctionParameter>::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::<BNFunctionParameter>::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 { |
