aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/pdb
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-03-24 12:08:08 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-03-24 12:17:29 +0300
commit368537c7f4fc74f60be1e4e211f488b7dab654a7 (patch)
tree2a88ffa7ae59341b4ea849f20a9229a7c556db92 /include/pdb
parentWIP (diff)
downloadwinapi-debug-368537c7f4fc74f60be1e4e211f488b7dab654a7.tar.gz
winapi-debug-368537c7f4fc74f60be1e4e211f488b7dab654a7.zip
fix a bug where I failed to account for TCHARs, again
Diffstat (limited to 'include/pdb')
-rw-r--r--include/pdb/symbol.hpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/pdb/symbol.hpp b/include/pdb/symbol.hpp
index 6a62e22..f843df7 100644
--- a/include/pdb/symbol.hpp
+++ b/include/pdb/symbol.hpp
@@ -15,6 +15,7 @@
#include <climits>
#include <cstddef>
#include <string>
+#include <type_traits>
namespace pdb {
namespace symbol {
@@ -61,7 +62,9 @@ public:
bool is_function() const { return get_type() == Type::Function; }
private:
- static constexpr std::size_t max_buffer_size = sizeof(Impl) + MAX_SYM_NAME - 1;
+ static constexpr std::size_t char_size = sizeof(std::remove_extent<decltype(Impl::Name)>::type);
+ static_assert(char_size == sizeof(wchar_t), "Aren't we using the wide WinAPI?");
+ static constexpr std::size_t max_buffer_size = sizeof(Impl) + (MAX_SYM_NAME - 1) * char_size;
std::array<unsigned char, max_buffer_size> buffer;
Address displacement = 0;