diff options
author | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-30 13:02:03 +0000 |
---|---|---|
committer | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-30 13:02:03 +0000 |
commit | c88873923d37e1d77d985f8fe614aaf835dcfa82 (patch) | |
tree | ef1c4f68daac23e83b2bc149c9b5802781bf3815 /base/message_loop_unittest.cc | |
parent | f9fb868acd8f9977254f33fc50565a9b7bdb3295 (diff) | |
download | chromium_src-c88873923d37e1d77d985f8fe614aaf835dcfa82.zip chromium_src-c88873923d37e1d77d985f8fe614aaf835dcfa82.tar.gz chromium_src-c88873923d37e1d77d985f8fe614aaf835dcfa82.tar.bz2 |
Fix most issues when building base as a x64 target.
BUG=1282556
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop_unittest.cc')
-rw-r--r-- | base/message_loop_unittest.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/base/message_loop_unittest.cc b/base/message_loop_unittest.cc index 374a618..6c71c5b0 100644 --- a/base/message_loop_unittest.cc +++ b/base/message_loop_unittest.cc @@ -201,10 +201,22 @@ class CrasherTask : public Task { ::SetUnhandledExceptionFilter(&BadExceptionHandler); // Generate a SEH fault. We do it in asm to make sure we know how to undo // the damage. + +#if defined(_M_IX86) + __asm { mov eax, dword ptr [CrasherTask::bad_array_] mov byte ptr [eax], 66 } + +#elif defined(_M_X64) + + bad_array_[0] = 66; + +#elif + +#endif + MessageLoop::current()->Quit(); } // Points the bad array to a valid memory location. @@ -229,7 +241,17 @@ LONG WINAPI HandleCrasherTaskException(EXCEPTION_POINTERS *ex_info) { return EXCEPTION_EXECUTE_HANDLER; CrasherTask::FixError(); + +#if defined(_M_IX86) + ex_info->ContextRecord->Eip -= 5; + +#elif defined(_M_X64) + + ex_info->ContextRecord->Rip -= 5; + +#endif + return EXCEPTION_CONTINUE_EXECUTION; } @@ -267,6 +289,7 @@ TEST(MessageLoopTest, CrasherNasty) { ::SetUnhandledExceptionFilter(old_SEH_filter); } + TEST(MessageLoopTest, Nesting) { int depth = 100; MessageLoop::current()->PostTask(FROM_HERE, new NestingTest(&depth)); |