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

Unified Diff: runtime/vm/parser.cc

Issue 1484653002: Fixes setjmp clobbering warnings. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 | « runtime/bin/builtin_natives.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 077a504891014b52adf06375346e4f0153f633e7..ecdfc5874e6301287baf8e8c6ccbb7a9987aebd1 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -828,12 +828,11 @@ void Parser::ParseClass(const Class& cls) {
RawObject* Parser::ParseFunctionParameters(const Function& func) {
ASSERT(!func.IsNull());
- Thread* thread = Thread::Current();
- Isolate* isolate = thread->isolate();
- StackZone stack_zone(thread);
- Zone* zone = stack_zone.GetZone();
LongJumpScope jump;
if (setjmp(*jump.Set()) == 0) {
+ Thread* thread = Thread::Current();
+ StackZone stack_zone(thread);
+ Zone* zone = stack_zone.GetZone();
const Script& script = Script::Handle(zone, func.script());
const Class& owner = Class::Handle(zone, func.Owner());
ASSERT(!owner.IsNull());
@@ -864,6 +863,8 @@ RawObject* Parser::ParseFunctionParameters(const Function& func) {
}
return param_descriptor.raw();
} else {
+ Thread* thread = Thread::Current();
+ Isolate* isolate = thread->isolate();
Error& error = Error::Handle();
error = isolate->object_store()->sticky_error();
isolate->object_store()->clear_sticky_error();
@@ -1008,12 +1009,11 @@ void Parser::ParseFunction(ParsedFunction* parsed_function) {
RawObject* Parser::ParseMetadata(const Class& cls, intptr_t token_pos) {
- Thread* thread = Thread::Current();
- Isolate* isolate = thread->isolate();
- StackZone stack_zone(thread);
- Zone* zone = stack_zone.GetZone();
LongJumpScope jump;
if (setjmp(*jump.Set()) == 0) {
+ Thread* thread = Thread::Current();
+ StackZone stack_zone(thread);
+ Zone* zone = stack_zone.GetZone();
const Script& script = Script::Handle(zone, cls.script());
// Parsing metadata can involve following paths in the parser that are
// normally used for expressions and assume current_function is non-null,
@@ -1038,6 +1038,10 @@ RawObject* Parser::ParseMetadata(const Class& cls, intptr_t token_pos) {
RawObject* metadata = parser.EvaluateMetadata();
return metadata;
} else {
+ Thread* thread = Thread::Current();
+ Isolate* isolate = thread->isolate();
+ StackZone stack_zone(thread);
+ Zone* zone = stack_zone.GetZone();
Error& error = Error::Handle(zone);
error = isolate->object_store()->sticky_error();
isolate->object_store()->clear_sticky_error();
« no previous file with comments | « runtime/bin/builtin_natives.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698