From 68215ea14cfbaa4966f830d85d98f7f49b416455 Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Wed, 27 May 2026 16:06:21 -0700 Subject: [Python] Ensure that BNFreeParseError is used to free the error returned by BNParseExpression --- python/generator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'python/generator.cpp') diff --git a/python/generator.cpp b/python/generator.cpp index 82eed91b..7ec2279a 100644 --- a/python/generator.cpp +++ b/python/generator.cpp @@ -504,7 +504,7 @@ int main(int argc, char* argv[]) // From python -> C python3 requires str -> str.encode('charmap') bool swizzleArgs = true; - if (name == "BNFreeString") + if (name == "BNFreeString" || name == "BNFreeParseError") swizzleArgs = false; bool callbackConvention = false; @@ -531,9 +531,9 @@ int main(int argc, char* argv[]) for (auto& j : i.second->GetParameters()) { fprintf(out, "\t\t"); - if (name == "BNFreeString") + if (name == "BNFreeString" || name == "BNFreeParseError") { - // BNFreeString expects a pointer to a string allocated by the core, so do not use + // These expect a pointer to a string allocated by the core, so do not use // a c_char_p here, as that would be allocated by the Python runtime. This can // be enforced by outputting like a return value. OutputType(out, j.type.GetValue(), true); -- cgit v1.3.1