From c2c5c39c401b39d2057ebb19b843f53deb950f6e Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Tue, 9 Aug 2022 21:46:56 +0200 Subject: [PATCH] [pseudo] Fix a suspicious usage of `sizeof(this)`. It should be `sizeof(*this)`. --- clang-tools-extra/pseudo/include/clang-pseudo/Forest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang-tools-extra/pseudo/include/clang-pseudo/Forest.h b/clang-tools-extra/pseudo/include/clang-pseudo/Forest.h index 130cf1a..f25e4cf 100644 --- a/clang-tools-extra/pseudo/include/clang-pseudo/Forest.h +++ b/clang-tools-extra/pseudo/include/clang-pseudo/Forest.h @@ -179,7 +179,7 @@ public: } size_t nodeCount() const { return NodeCount; } - size_t bytes() const { return Arena.getBytesAllocated() + sizeof(this); } + size_t bytes() const { return Arena.getBytesAllocated() + sizeof(*this); } private: ForestNode &create(ForestNode::Kind K, SymbolID SID, Token::Index Start, -- 2.7.4