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

Unified Diff: base/allocator/generic_allocators.cc

Issue 8487004: Crash on error or assert message in Debug build (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/allocator/generic_allocators.cc
===================================================================
--- base/allocator/generic_allocators.cc (revision 108802)
+++ base/allocator/generic_allocators.cc (working copy)
@@ -105,15 +105,32 @@
#undef malloc
#undef free
#undef calloc
-int _CrtDbgReport(int, const char*, int, const char*, const char*, ...) {
+
+static int error_handler(int reportType) {
+ if (reportType == 0) // _CRT_WARN
rvargas (doing something else) 2011/11/07 18:53:50 It is not clear to me that this is the right thing
+ return 0;
+ // Remaining alternatives are _CRT_ERROR, and _CRT_ASSERT.
+ char* p = NULL;
+ *p = '0';
rvargas (doing something else) 2011/11/07 18:53:50 Can we just DCHECK here instead? You're probably t
return 0;
}
-int _CrtDbgReportW(int, const wchar_t*, int, const wchar_t*,
- const wchar_t*, ...) {
- return 0;
+int _CrtDbgReport(int reportType,
+ const char*,
+ int, const char*,
+ const char*,
+ ...) {
+ return error_handler(reportType);
}
+int _CrtDbgReportW(int reportType,
+ const wchar_t*,
+ int, const wchar_t*,
+ const wchar_t*,
+ ...) {
+ return error_handler(reportType);
+}
+
int _CrtSetReportMode(int, int) {
return 0;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698