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

Side by Side Diff: src/unicode-decoder.h

Issue 2521933002: Merged: Fix out-of-range access in unibrow::Utf8::CalculateValue. (Closed)
Patch Set: Created 4 years, 1 month 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/unicode.cc ('k') | test/unittests/BUILD.gn » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_UNICODE_DECODER_H_ 5 #ifndef V8_UNICODE_DECODER_H_
6 #define V8_UNICODE_DECODER_H_ 6 #define V8_UNICODE_DECODER_H_
7 7
8 #include <sys/types.h> 8 #include <sys/types.h>
9 #include "src/globals.h" 9 #include "src/globals.h"
10 #include "src/utils.h"
10 11
11 namespace unibrow { 12 namespace unibrow {
12 13
13 class Utf8DecoderBase { 14 class V8_EXPORT_PRIVATE Utf8DecoderBase {
14 public: 15 public:
15 // Initialization done in subclass. 16 // Initialization done in subclass.
16 inline Utf8DecoderBase(); 17 inline Utf8DecoderBase();
17 inline Utf8DecoderBase(uint16_t* buffer, size_t buffer_length, 18 inline Utf8DecoderBase(uint16_t* buffer, size_t buffer_length,
18 const uint8_t* stream, size_t stream_length); 19 const uint8_t* stream, size_t stream_length);
19 inline size_t Utf16Length() const { return utf16_length_; } 20 inline size_t Utf16Length() const { return utf16_length_; }
20 21
21 protected: 22 protected:
22 // This reads all characters and sets the utf16_length_. 23 // This reads all characters and sets the utf16_length_.
23 // The first buffer_length utf16 chars are cached in the buffer. 24 // The first buffer_length utf16 chars are cached in the buffer.
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 case 0x178: 114 case 0x178:
114 return 0xff; 115 return 0xff;
115 } 116 }
116 return 0; 117 return 0;
117 } 118 }
118 119
119 120
120 } // namespace unibrow 121 } // namespace unibrow
121 122
122 #endif // V8_UNICODE_DECODER_H_ 123 #endif // V8_UNICODE_DECODER_H_
OLDNEW
« no previous file with comments | « src/unicode.cc ('k') | test/unittests/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698