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

Unified Diff: src/full-codegen.cc

Issue 10537078: Preserve error message during finally block in try..finally. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 6 months 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 | « src/full-codegen.h ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen.cc
diff --git a/src/full-codegen.cc b/src/full-codegen.cc
index 9b1df4ee735dd314b94ac3ee0101dd43cd1eebcb..4ddc0ae5c8ab936611ba55f98b5867721ce2b4ac 100644
--- a/src/full-codegen.cc
+++ b/src/full-codegen.cc
@@ -1287,7 +1287,11 @@ void FullCodeGenerator::VisitTryFinallyStatement(TryFinallyStatement* stmt) {
// is thrown. The exception is in the result register, and must be
// preserved by the finally block. Call the finally block and then
// rethrow the exception if it returns.
+ // Preserve the pending message corresponding to the thrown error when
+ // executing the finally block.
+ SavePendingMessage();
__ Call(&finally_entry);
+ RestorePendingMessage();
__ push(result_register());
__ CallRuntime(Runtime::kReThrow, 1);
« no previous file with comments | « src/full-codegen.h ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698