summaryrefslogtreecommitdiff
path: root/platform.cpp
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2020-06-12 16:27:36 -0400
committerPeter LaFosse <peter@vector35.com>2020-06-23 09:02:48 -0400
commite0fbcc712f8ca31914d2f1e04b7f8b16eff44d66 (patch)
tree1c79e6e76f4d0bdf6dfc09c3cd3036dbf96c56f2 /platform.cpp
parent4ffa5187aa0c9589dffac5bf00f3a7dd423578e8 (diff)
Add BinaryView.parse_types_from_string to the python API and update how the underlying BNParseTypesString works
Diffstat (limited to 'platform.cpp')
-rw-r--r--platform.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/platform.cpp b/platform.cpp
index 070c6d94..1a94b34d 100644
--- a/platform.cpp
+++ b/platform.cpp
@@ -430,6 +430,7 @@ bool Platform::ParseTypesFromSource(const string& source, const string& fileName
&errorStr, includeDirList, includeDirs.size(), autoTypeSource.c_str());
errors = errorStr;
BNFreeString(errorStr);
+ delete[] includeDirList;
if (!ok)
return false;
@@ -441,14 +442,13 @@ bool Platform::ParseTypesFromSource(const string& source, const string& fileName
for (size_t i = 0; i < result.variableCount; i++)
{
QualifiedName name = QualifiedName::FromAPIObject(&result.variables[i].name);
- types[name] = new Type(BNNewTypeReference(result.variables[i].type));
+ variables[name] = new Type(BNNewTypeReference(result.variables[i].type));
}
for (size_t i = 0; i < result.functionCount; i++)
{
QualifiedName name = QualifiedName::FromAPIObject(&result.functions[i].name);
- types[name] = new Type(BNNewTypeReference(result.functions[i].type));
+ functions[name] = new Type(BNNewTypeReference(result.functions[i].type));
}
- delete[] includeDirList;
BNFreeTypeParserResult(&result);
return true;
}
@@ -473,6 +473,7 @@ bool Platform::ParseTypesFromSourceFile(const string& fileName, map<QualifiedNam
includeDirList, includeDirs.size(), autoTypeSource.c_str());
errors = errorStr;
BNFreeString(errorStr);
+ delete[] includeDirList;
if (!ok)
return false;