Index: runtime/vm/object.cc |
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
index 730d5605b16b7a2f2cfa1bd21d8272a3950a61e1..a345676176403bcea18a039a3b0aa18c0801e879 100644 |
--- a/runtime/vm/object.cc |
+++ b/runtime/vm/object.cc |
@@ -2694,7 +2694,7 @@ RawFunction* Function::CreateMethodExtractor(const String& getter_name) const { |
false, // Not external. |
false, // Not native. |
owner, |
- 0)); // token_pos |
+ ClassifyingTokenPositions::kMethodExtractor)); // token_pos |
// Initialize signature: receiver is a single fixed parameter. |
const intptr_t kNumParameters = 1; |
@@ -5787,7 +5787,7 @@ void Function::set_recognized_kind(MethodRecognizer::Kind value) const { |
void Function::set_token_pos(intptr_t token_pos) const { |
- ASSERT(token_pos >= 0); |
+ ASSERT((token_pos >= 0) || IsMethodExtractor()); |
StoreNonPointer(&raw_ptr()->token_pos_, token_pos); |
} |
@@ -8547,7 +8547,10 @@ TokenStream::Iterator::Iterator(const TokenStream& tokens, |
cur_token_kind_(Token::kILLEGAL), |
cur_token_obj_index_(-1), |
stream_type_(stream_type) { |
- SetCurrentPosition(token_pos); |
+ ASSERT(token_pos != Scanner::kNoSourcePos); |
+ if (token_pos >= 0) { |
+ SetCurrentPosition(token_pos); |
+ } |
} |