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

Unified Diff: runtime/vm/object.cc

Issue 281983002: Add asserts to verify handle is always non null and the kIDENT literal (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 36174)
+++ runtime/vm/object.cc (working copy)
@@ -7411,19 +7411,17 @@
// Add an IDENT token into the stream and the token objects array.
void AddIdentToken(const String* ident) {
- if (ident != NULL) {
- // If the IDENT token is already in the tokens object array use the
- // same index instead of duplicating it.
- intptr_t index = FindIdentIndex(ident);
- if (index == -1) {
- WriteIndex(token_objects_.Length());
- ASSERT(ident != NULL);
- token_objects_.Add(*ident);
- } else {
- WriteIndex(index);
- }
+ ASSERT(ident != NULL);
+ ASSERT(ident->IsSymbol());
+ // If the IDENT token is already in the tokens object array use the
+ // same index instead of duplicating it.
+ intptr_t index = FindIdentIndex(ident);
+ if (index == -1) {
+ WriteIndex(token_objects_.Length());
+ ASSERT(ident != NULL);
+ token_objects_.Add(*ident);
} else {
- WriteIndex(0);
+ WriteIndex(index);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698