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

Unified Diff: src/compiler.cc

Issue 3398014: Fix possible evaluation order problems. (Closed)
Patch Set: fixed more places Created 10 years, 3 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
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index f65f94156740f86ce945730d0a885b10b390b65d..825198edbd0a37f04fec2b8c774cc803cfaaf5fb 100755
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -120,8 +120,9 @@ Handle<Code> MakeCodeForLiveEdit(CompilationInfo* info) {
Handle<Context> context = Handle<Context>::null();
Handle<Code> code = MakeCode(context, info);
if (!info->shared_info().is_null()) {
- info->shared_info()->set_scope_info(
- *SerializedScopeInfo::Create(info->scope()));
+ Handle<SerializedScopeInfo> scope_info =
+ SerializedScopeInfo::Create(info->scope());
+ info->shared_info()->set_scope_info(*scope_info);
}
return code;
}
@@ -420,10 +421,12 @@ bool Compiler::CompileLazy(CompilationInfo* info) {
// Update the shared function info with the compiled code and the scope info.
// Please note, that the order of the sharedfunction initialization is
- // important since set_scope_info might trigger a GC, causing the ASSERT
- // below to be invalid if the code was flushed. By settting the code
+ // important since SerializedScopeInfo::Create might trigger a GC, causing
+ // the ASSERT below to be invalid if the code was flushed. By setting the code
// object last we avoid this.
- shared->set_scope_info(*SerializedScopeInfo::Create(info->scope()));
+ Handle<SerializedScopeInfo> scope_info =
+ SerializedScopeInfo::Create(info->scope());
+ shared->set_scope_info(*scope_info);
shared->set_code(*code);
if (!info->closure().is_null()) {
info->closure()->set_code(*code);
« src/bootstrapper.cc ('K') | « src/compilation-cache.cc ('k') | src/handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698