Commit b001c54d authored by Brad King's avatar Brad King 💬 Committed by Kitware Robot
Browse files

Merge topic 'SystemInformation-demangle-buffer'

5d4c8b04

 SystemInformation: Simplify demangle buffer management

Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !226
parents d5fd6ca2 5d4c8b04
......@@ -1356,14 +1356,12 @@ std::string SymbolProperties::Demangle(const char* symbol) const
std::string result = safes(symbol);
# if defined(KWSYS_SYSTEMINFORMATION_HAS_CPP_DEMANGLE)
int status = 0;
size_t bufferLen = 1024;
char* buffer = (char*)malloc(1024);
char* demangledSymbol =
abi::__cxa_demangle(symbol, buffer, &bufferLen, &status);
abi::__cxa_demangle(symbol, nullptr, nullptr, &status);
if (!status) {
result = demangledSymbol;
}
free(buffer);
free(demangledSymbol);
# else
(void)symbol;
# endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment