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

Side by Side Diff: runtime/vm/object.cc

Issue 460233005: Fix one missing invalid encoding case. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | « no previous file | runtime/vm/object_test.cc » ('j') | 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/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 16744 matching lines...) Expand 10 before | Expand all | Expand 10 after
16755 } 16755 }
16756 int32_t code_point = cpi.Current(); 16756 int32_t code_point = cpi.Current();
16757 if (!IsHexCharacter(code_point)) { 16757 if (!IsHexCharacter(code_point)) {
16758 return String::null(); 16758 return String::null();
16759 } 16759 }
16760 if (!cpi.Next()) { 16760 if (!cpi.Next()) {
16761 return String::null(); 16761 return String::null();
16762 } 16762 }
16763 code_point = cpi.Current(); 16763 code_point = cpi.Current();
16764 if (!IsHexCharacter(code_point)) { 16764 if (!IsHexCharacter(code_point)) {
16765 return str.raw(); 16765 return String::null();
16766 } 16766 }
16767 num_escapes += 2; 16767 num_escapes += 2;
16768 } 16768 }
16769 } 16769 }
16770 } 16770 }
16771 intptr_t utf8_len = len - num_escapes; 16771 intptr_t utf8_len = len - num_escapes;
16772 ASSERT(utf8_len >= 0); 16772 ASSERT(utf8_len >= 0);
16773 Zone* zone = Isolate::Current()->current_zone(); 16773 Zone* zone = Isolate::Current()->current_zone();
16774 uint8_t* utf8 = zone->Alloc<uint8_t>(utf8_len); 16774 uint8_t* utf8 = zone->Alloc<uint8_t>(utf8_len);
16775 { 16775 {
(...skipping 2689 matching lines...) Expand 10 before | Expand all | Expand 10 after
19465 return tag_label.ToCString(); 19465 return tag_label.ToCString();
19466 } 19466 }
19467 19467
19468 19468
19469 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 19469 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
19470 Instance::PrintJSONImpl(stream, ref); 19470 Instance::PrintJSONImpl(stream, ref);
19471 } 19471 }
19472 19472
19473 19473
19474 } // namespace dart 19474 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698