Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2816)

Unified Diff: core/fxcrt/fx_basic_wstring.cpp

Issue 1904143002: Assert that CFX_ strings are pointer-size. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fxcrt/fx_basic_bstring.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcrt/fx_basic_wstring.cpp
diff --git a/core/fxcrt/fx_basic_wstring.cpp b/core/fxcrt/fx_basic_wstring.cpp
index 069b9fa42d43ac1c5b506682ddc439ab406e76cf..f3b430c7bff3d2d7fc78babc66e2f7e55e20adab 100644
--- a/core/fxcrt/fx_basic_wstring.cpp
+++ b/core/fxcrt/fx_basic_wstring.cpp
@@ -59,6 +59,9 @@ const FX_WCHAR* FX_wcsstr(const FX_WCHAR* haystack,
} // namespace
+static_assert(sizeof(CFX_WideString) <= sizeof(FX_WCHAR*),
+ "Strings must not require more space than pointers");
+
CFX_WideString::CFX_WideString(const FX_WCHAR* pStr, FX_STRSIZE nLen) {
if (nLen < 0)
nLen = pStr ? FXSYS_wcslen(pStr) : 0;
« no previous file with comments | « core/fxcrt/fx_basic_bstring.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698