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

Side by Side Diff: src/string-stream.h

Issue 275016: Fix overflow in failure "requested size" field. (Closed)
Patch Set: Created 11 years, 2 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
« no previous file with comments | « src/objects-inl.h ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 enum Type { INT, DOUBLE, C_STR, LC_STR, OBJ, HANDLE, POINTER }; 98 enum Type { INT, DOUBLE, C_STR, LC_STR, OBJ, HANDLE, POINTER };
99 Type type_; 99 Type type_;
100 union { 100 union {
101 int u_int_; 101 int u_int_;
102 double u_double_; 102 double u_double_;
103 const char* u_c_str_; 103 const char* u_c_str_;
104 const Vector<const uc16>* u_lc_str_; 104 const Vector<const uc16>* u_lc_str_;
105 Object* u_obj_; 105 Object* u_obj_;
106 Object** u_handle_; 106 Object** u_handle_;
107 void* u_pointer_; 107 void* u_pointer_;
108 int64_t u_long_;
Kevin Millikin (Chromium) 2009/10/14 08:17:06 Why this change? Doesn't it need a corresponding
Lasse Reichstein 2009/10/14 08:49:52 Well spotted. I started adding a long type, but dr
108 } data_; 109 } data_;
109 }; 110 };
110 111
111 112
112 class StringStream { 113 class StringStream {
113 public: 114 public:
114 explicit StringStream(StringAllocator* allocator): 115 explicit StringStream(StringAllocator* allocator):
115 allocator_(allocator), 116 allocator_(allocator),
116 capacity_(kInitialCapacity), 117 capacity_(kInitialCapacity),
117 length_(0), 118 length_(0),
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 bool full() const { return (capacity_ - length_) == 1; } 181 bool full() const { return (capacity_ - length_) == 1; }
181 int space() const { return capacity_ - length_; } 182 int space() const { return capacity_ - length_; }
182 183
183 DISALLOW_IMPLICIT_CONSTRUCTORS(StringStream); 184 DISALLOW_IMPLICIT_CONSTRUCTORS(StringStream);
184 }; 185 };
185 186
186 187
187 } } // namespace v8::internal 188 } } // namespace v8::internal
188 189
189 #endif // V8_STRING_STREAM_H_ 190 #endif // V8_STRING_STREAM_H_
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698