+2011-09-15 Chris Marrin <cmarrin@apple.com>
+
+ Crash can occur when doing a PlatformCAAnimation::copy() with no valueFunction
+ https://bugs.webkit.org/show_bug.cgi?id=67510
+
+ Reviewed by Adam Roben.
+
+ Another fix to take care of one last crash when running pause-crash.html.
+ CACF can't deal with null valueFunctions, so avoid setting it when it doesn't
+ exist.
+
+ This also adds logic to the Windows Hook in LayerChangesFlusher to prevent it
+ from catching the null pointer exception generated by the pause-crash.html test
+ before this bug was fixed. Windows was ignoring the exception, so the testcase
+ would appear to succeed, even though it should have crashed.
+
+ * WebCore.vcproj/WebCore.vcproj:
+ * platform/graphics/ca/win/LayerChangesFlusher.cpp:
+ (WebCore::LayerChangesFlusher::hookCallback):
+ * platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
+ (PlatformCAAnimation::copy):
+ * platform\win\StructuredExceptionHandlerSupressor.h: New file to encapsulate the exception handling supression.
+
2011-09-15 David Hyatt <hyatt@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=27579
--- /dev/null
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef StructuredExceptionHandlerSupressor_h
+#define StructuredExceptionHandlerSupressor_h
+
+namespace WebCore {
+
+class StructuredExceptionHandlerSupressor {
+ WTF_MAKE_NONCOPYABLE(StructuredExceptionHandlerSupressor);
+public:
+ StructuredExceptionHandlerSupressor()
+ {
+ // Windows puts an __try/__except block around some calls, such as hooks.
+ // The exception handler then ignores system exceptions like invalid addresses
+ // and null pointers. This class can be used to remove this block and prevent
+ // it from catching the exception. Typically this will cause the exception to crash
+ // which is often desirable to allow crashlogs to be recorded for debugging purposed.
+ // While this class is in scope we replace the Windows exception handler with 0xffffffff,
+ // which indicates that the exception should not be handled.
+
+ // Windows doesn't like assigning to member variables, so we need to get the value into
+ // a local variable and store it afterwards.
+ void* registration;
+
+ __asm mov eax, FS:[0]
+ __asm mov [registration], eax
+ __asm mov eax, 0xffffffff
+ __asm mov FS:[0], eax
+
+ m_savedExceptionRegistration = registration;
+ }
+
+ ~StructuredExceptionHandlerSupressor()
+ {
+ // Restore the exception handler
+ __asm mov eax, [m_savedExceptionRegistration]
+ __asm mov FS:[0], eax
+ }
+
+private:
+ void* m_savedExceptionRegistration;
+};
+
+} // namespace WebCore
+
+#endif // StructuredExceptionHandlerSupressor_h