diff options
author | Nico Weber <nicolasweber@gmx.de> | 2018-11-11 10:09:06 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2018-11-11 10:09:06 +0000 |
commit | a0f1a4ad4d5a74b37760cfcc29418d119c03bc1e (patch) | |
tree | f8366de9d124d932ec6b1051117e66b853177291 | |
parent | fe2c6d771d48b361dd6d57d0536e9b30474a5dd5 (diff) |
Port LLVM r346606 to libcxxabi.
-rw-r--r-- | libcxxabi/src/cxa_demangle.cpp | 2 | ||||
-rw-r--r-- | libcxxabi/src/demangle/Utility.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libcxxabi/src/cxa_demangle.cpp b/libcxxabi/src/cxa_demangle.cpp index 69fdca4e939..f227addbdae 100644 --- a/libcxxabi/src/cxa_demangle.cpp +++ b/libcxxabi/src/cxa_demangle.cpp @@ -352,7 +352,7 @@ __cxa_demangle(const char *MangledName, char *Buf, size_t *N, int *Status) { if (AST == nullptr) InternalStatus = demangle_invalid_mangled_name; - else if (initializeOutputStream(Buf, N, S, 1024)) + else if (!initializeOutputStream(Buf, N, S, 1024)) InternalStatus = demangle_memory_alloc_failure; else { assert(Parser.ForwardTemplateRefs.empty()); diff --git a/libcxxabi/src/demangle/Utility.h b/libcxxabi/src/demangle/Utility.h index 86113763031..b5e9b5e42cf 100644 --- a/libcxxabi/src/demangle/Utility.h +++ b/libcxxabi/src/demangle/Utility.h @@ -176,13 +176,13 @@ inline bool initializeOutputStream(char *Buf, size_t *N, OutputStream &S, if (Buf == nullptr) { Buf = static_cast<char *>(std::malloc(InitSize)); if (Buf == nullptr) - return true; + return false; BufferSize = InitSize; } else BufferSize = *N; S.reset(Buf, BufferSize); - return false; + return true; } } // namespace |