Author: olehougaard
Date: Fri Dec 5 01:57:36 2008
New Revision: 921
Modified:
branches/bleeding_edge/src/compiler.cc
Log:
Checking and reporting for stack overflow in the right places.
Review URL: http://codereview.chromium.org/12986
Modified: branches/bleeding_edge/src/compiler.cc
==============================================================================
--- branches/bleeding_edge/src/compiler.cc (original)
+++ branches/bleeding_edge/src/compiler.cc Fri Dec 5 01:57:36 2008
@@ -74,11 +74,6 @@
// Generate code and return it.
Handle<Code> result = CodeGenerator::MakeCode(literal, script, is_eval);
- // Check for stack-overflow exception.
- if (result.is_null()) {
- Top::StackOverflow();
- Top::ReportPendingMessages();
- }
return result;
}
@@ -123,6 +118,8 @@
// Check for stack-overflow exceptions.
if (code.is_null()) {
+ Top::StackOverflow();
+ Top::ReportPendingMessages();
return Handle<JSFunction>::null();
}
@@ -211,8 +208,6 @@
}
}
- if (result.is_null()) Top::ReportPendingMessages();
-
return result;
}
@@ -243,8 +238,6 @@
}
}
- if (result.is_null()) Top::ReportPendingMessages();
-
return result;
}
@@ -294,7 +287,10 @@
// Compile the code.
Handle<Code> code = MakeCode(lit, script, false);
+ // Check for stack-overflow exception.
if (code.is_null()) {
+ Top::StackOverflow();
+ Top::ReportPendingMessages();
return false;
}
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---