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

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

Issue 12387019: Fix null-termination bug in Stacktrace::ToCString. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: adjusted dart2js status file Created 7 years, 9 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 | tests/language/language_dart2js.status » ('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/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 13018 matching lines...) Expand 10 before | Expand all | Expand 10 after
13029 total_len += len; 13029 total_len += len;
13030 chars = isolate->current_zone()->Alloc<char>(len + 1); 13030 chars = isolate->current_zone()->Alloc<char>(len + 1);
13031 OS::SNPrint(chars, (len + 1), kFormat, 13031 OS::SNPrint(chars, (len + 1), kFormat,
13032 i, 13032 i,
13033 function_name.ToCString(), 13033 function_name.ToCString(),
13034 url.ToCString(), 13034 url.ToCString(),
13035 line, column); 13035 line, column);
13036 frame_strings.Add(chars); 13036 frame_strings.Add(chars);
13037 } 13037 }
13038 13038
13039 // Now concatentate the frame descriptions into a single C string. 13039 // Now concatenate the frame descriptions into a single C string.
13040 chars = isolate->current_zone()->Alloc<char>(total_len + 1); 13040 chars = isolate->current_zone()->Alloc<char>(total_len + 1);
13041 intptr_t index = 0; 13041 intptr_t index = 0;
13042 for (intptr_t i = 0; i < frame_strings.length(); i++) { 13042 for (intptr_t i = 0; i < frame_strings.length(); i++) {
13043 index += OS::SNPrint((chars + index), 13043 index += OS::SNPrint((chars + index),
13044 (total_len + 1 - index), 13044 (total_len + 1 - index),
13045 "%s", 13045 "%s",
13046 frame_strings[i]); 13046 frame_strings[i]);
13047 } 13047 }
13048 chars[total_len] = '\0';
13048 return chars; 13049 return chars;
13049 } 13050 }
13050 13051
13051 13052
13052 void JSRegExp::set_pattern(const String& pattern) const { 13053 void JSRegExp::set_pattern(const String& pattern) const {
13053 StorePointer(&raw_ptr()->pattern_, pattern.raw()); 13054 StorePointer(&raw_ptr()->pattern_, pattern.raw());
13054 } 13055 }
13055 13056
13056 13057
13057 void JSRegExp::set_num_bracket_expressions(intptr_t value) const { 13058 void JSRegExp::set_num_bracket_expressions(intptr_t value) const {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
13160 } 13161 }
13161 return result.raw(); 13162 return result.raw();
13162 } 13163 }
13163 13164
13164 13165
13165 const char* WeakProperty::ToCString() const { 13166 const char* WeakProperty::ToCString() const {
13166 return "_WeakProperty"; 13167 return "_WeakProperty";
13167 } 13168 }
13168 13169
13169 } // namespace dart 13170 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698