From e0fbcc712f8ca31914d2f1e04b7f8b16eff44d66 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Fri, 12 Jun 2020 16:27:36 -0400 Subject: Add BinaryView.parse_types_from_string to the python API and update how the underlying BNParseTypesString works --- platform.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'platform.cpp') 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