From 368537c7f4fc74f60be1e4e211f488b7dab654a7 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 24 Mar 2020 12:08:08 +0300 Subject: fix a bug where I failed to account for TCHARs, again --- src/symbol.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/symbol.cpp b/src/symbol.cpp index 1973f0b..3b0f5d9 100644 --- a/src/symbol.cpp +++ b/src/symbol.cpp @@ -16,13 +16,15 @@ #include #include #include +#include namespace pdb { namespace { std::size_t calc_size(const SymbolInfo::Impl& impl) { try { - return SafeInt{impl.SizeOfStruct} + impl.NameLen - 1; + static constexpr auto char_size = sizeof(std::remove_extent::type); + return SafeInt{impl.SizeOfStruct} + (impl.NameLen - 1) * char_size; } catch (const SafeIntException&) { throw std::runtime_error{"invalid SYMBOL_INFO size"}; } -- cgit v1.2.3