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

Unified Diff: runtime/vm/parser.cc

Issue 23004015: Remove assertion in compile-time constant map literals (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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 | tests/co19/co19-runtime.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 26531)
+++ runtime/vm/parser.cc (working copy)
@@ -9287,10 +9287,11 @@
ASSERT(key->IsLiteralNode());
const Instance& new_key = key->AsLiteralNode()->literal();
for (int i = 0; i < pairs->length(); i += 2) {
- const Instance& key_i =
- (*pairs)[i]->AsLiteralNode()->literal();
- ASSERT(key_i.IsString());
- if (new_key.Equals(key_i)) {
+ const Instance& key_i = (*pairs)[i]->AsLiteralNode()->literal();
+ // The keys of a compile time constant map are compile time
+ // constants, i.e. canonicalized values. Thus, we can compare
+ // raw pointers to check for equality.
+ if (new_key.raw() == key_i.raw()) {
// Duplicate key found. The new value replaces the previously
// defined value.
(*pairs)[i + 1] = value;
« no previous file with comments | « no previous file | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698