Commit aa8bec2f authored by oliver@apple.com's avatar oliver@apple.com

Crash in profiler due to incorrect assuming displayName would be a string.

Reviewed by Steve Falkenburg

Fixed by adding a type guard.


git-svn-id: svn://svn.chromium.org/blink/trunk@43006 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 8344ff32
2009-04-29 Oliver Hunt <oliver@apple.com>
Reviewed by Steve Falkenburg.
Crash in profiler due to incorrect assuming displayName would be a string.
Fixed by adding a type guard.
* runtime/InternalFunction.cpp:
(JSC::InternalFunction::displayName):
2009-04-28 Geoffrey Garen <ggaren@apple.com> 2009-04-28 Geoffrey Garen <ggaren@apple.com>
Rubber stamped by Beth Dakin. Rubber stamped by Beth Dakin.
...@@ -52,7 +52,7 @@ const UString InternalFunction::displayName(JSGlobalData* globalData) ...@@ -52,7 +52,7 @@ const UString InternalFunction::displayName(JSGlobalData* globalData)
{ {
JSValuePtr displayName = getDirect(globalData->propertyNames->displayName); JSValuePtr displayName = getDirect(globalData->propertyNames->displayName);
if (displayName) if (displayName && isJSString(globalData, displayName))
return asString(displayName)->value(); return asString(displayName)->value();
return UString::null(); return UString::null();
......
2009-04-29 Oliver Hunt <oliver@apple.com>
Reviewed by Steve Falkenburg.
Add a test case for non-string value for Function.displayName in the profiler.
* fast/profiler/named-functions-with-display-names-expected.txt:
* fast/profiler/named-functions-with-display-names.html:
2009-04-29 Eric Carlson <eric.carlson@apple.com> 2009-04-29 Eric Carlson <eric.carlson@apple.com>
Disable media/video-zoom-controls.html on Windows for now. Disable media/video-zoom-controls.html on Windows for now.
...@@ -4,12 +4,13 @@ To run this test manually, load it in the browser then load the WebInspector and ...@@ -4,12 +4,13 @@ To run this test manually, load it in the browser then load the WebInspector and
Profile title: Named functions with display names Profile title: Named functions with display names
Thread_1 (no file) (line 0) Thread_1 (no file) (line 0)
startTest named-functions-with-display-names.html (line 46) startTest named-functions-with-display-names.html (line 54)
0 iterations function named-functions-with-display-names.html (line 11) 0 iterations function named-functions-with-display-names.html (line 11)
1 iteration function named-functions-with-display-names.html (line 18) 1 iteration function named-functions-with-display-names.html (line 18)
2 iterations function named-functions-with-display-names.html (line 25) 2 iterations function named-functions-with-display-names.html (line 25)
20 iterations function named-functions-with-display-names.html (line 32) 20 iterations function named-functions-with-display-names.html (line 32)
1000 iterations function named-functions-with-display-names.html (line 39) 1000 iterations function named-functions-with-display-names.html (line 39)
bogusDisplayNameFunction named-functions-with-display-names.html (line 47)
endTest profiler-test-JS-resources.js (line 1) endTest profiler-test-JS-resources.js (line 1)
...@@ -42,6 +42,14 @@ function function1000() ...@@ -42,6 +42,14 @@ function function1000()
function1000.displayName = "1000 iterations function"; function1000.displayName = "1000 iterations function";
function bogusDisplayNameFunction()
{
for (var i = 0; i < 0; ++i) ;
}
bogusDisplayNameFunction.displayName = bogusDisplayNameFunction;
function startTest() function startTest()
{ {
console.profile("Named functions with display names"); console.profile("Named functions with display names");
...@@ -51,6 +59,7 @@ function startTest() ...@@ -51,6 +59,7 @@ function startTest()
function2(); function2();
function20(); function20();
function1000(); function1000();
bogusDisplayNameFunction();
endTest(); endTest();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment