Skip to content

Commit e4bde97

Browse files
authored
Merge pull request Tencent#1988 from Tencent/revert-1987-fix-placement-new-alignment
Revert "Fix the alignment of placement new buffer for GenericValue."
2 parents bf8ca5d + 88bbd87 commit e4bde97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/rapidjson/document.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,8 +1235,8 @@ class GenericValue {
12351235
// return NullValue;
12361236

12371237
// Use static buffer and placement-new to prevent destruction
1238-
static GenericValid buffer;
1239-
return *new (reinterpret_cast<char *>(&buffer)) GenericValue();
1238+
static char buffer[sizeof(GenericValue)];
1239+
return *new (buffer) GenericValue();
12401240
}
12411241
}
12421242
template <typename SourceAllocator>

0 commit comments

Comments
 (0)