diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2020-01-17 20:45:01 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2020-01-17 20:45:01 +0000 |
| commit | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (patch) | |
| tree | 4adf86a776049cbf7f69a1929c4babcbbef925eb /lldb/source/Utility/Environment.cpp | |
| parent | 7cc9cf2bf09f069cb2dd947ead05d0b54301fb71 (diff) | |
Notes
Diffstat (limited to 'lldb/source/Utility/Environment.cpp')
| -rw-r--r-- | lldb/source/Utility/Environment.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Utility/Environment.cpp b/lldb/source/Utility/Environment.cpp index 1405336007124..8cafd3024618f 100644 --- a/lldb/source/Utility/Environment.cpp +++ b/lldb/source/Utility/Environment.cpp @@ -13,7 +13,7 @@ using namespace lldb_private; char *Environment::Envp::make_entry(llvm::StringRef Key, llvm::StringRef Value) { const size_t size = Key.size() + 1 /*=*/ + Value.size() + 1 /*\0*/; - char *Result = reinterpret_cast<char *>( + char *Result = static_cast<char *>( Allocator.Allocate(sizeof(char) * size, alignof(char))); char *Next = Result; @@ -26,7 +26,7 @@ char *Environment::Envp::make_entry(llvm::StringRef Key, } Environment::Envp::Envp(const Environment &Env) { - Data = reinterpret_cast<char **>( + Data = static_cast<char **>( Allocator.Allocate(sizeof(char *) * (Env.size() + 1), alignof(char *))); char **Next = Data; for (const auto &KV : Env) |
