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

Side by Side Diff: vm/intermediate_language_test.cc

Issue 10826299: Fix crash bug when replacing a definition with a definition that has no uses. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « vm/intermediate_language.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 #include "vm/unit_test.h" 6 #include "vm/unit_test.h"
7 7
8 namespace dart { 8 namespace dart {
9 9
10 TEST_CASE(InstructionTests) { 10 TEST_CASE(InstructionTests) {
(...skipping 21 matching lines...) Expand all
32 use1->RemoveFromUseList(); 32 use1->RemoveFromUseList();
33 EXPECT(def1->use_list()->next_use()->next_use() == NULL); 33 EXPECT(def1->use_list()->next_use()->next_use() == NULL);
34 use3->SetDefinition(def2); 34 use3->SetDefinition(def2);
35 EXPECT(def1->use_list() == use2); 35 EXPECT(def1->use_list() == use2);
36 EXPECT(def1->use_list()->next_use() == NULL); 36 EXPECT(def1->use_list()->next_use() == NULL);
37 EXPECT(def2->use_list() == use3); 37 EXPECT(def2->use_list() == use3);
38 EXPECT(def2->use_list()->next_use() == NULL); 38 EXPECT(def2->use_list()->next_use() == NULL);
39 BindInstr* bind = new BindInstr(BindInstr::kUsed, use2); 39 BindInstr* bind = new BindInstr(BindInstr::kUsed, use2);
40 bind->RemoveInputUses(); 40 bind->RemoveInputUses();
41 EXPECT(def1->use_list() == NULL); 41 EXPECT(def1->use_list() == NULL);
42 // Test replacing with a definition without uses.
43 UseVal* use4 = new UseVal(def2);
44 def2->ReplaceUsesWith(def1);
45 EXPECT(def1->use_list() == use4);
zerny-google 2012/08/14 11:04:36 Maybe check a few more properties here: EXPECT(de
Florian Schneider 2012/08/14 11:17:17 Done. Good point. I forgot to set the uselist of d
42 } 46 }
43 47
44 } // namespace dart 48 } // namespace dart
OLDNEW
« no previous file with comments | « vm/intermediate_language.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698