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

Side by Side Diff: src/wasm/utf8.h

Issue 1967023004: [wasm] Add UTF-8 validation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix signed/unsigned mismatch Created 4 years, 7 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
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
titzer 2016/05/12 08:29:14 I think we should put this in src/base, since it's
Clemens Hammacher 2016/05/12 11:21:41 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef V8_WASM_UNICODE_H_
6 #define V8_WASM_UNICODE_H_
7
8 #include <stdint.h>
9
10 // UTF8 validation is currently only needed for WASM, so we add this utility
11 // here.
12
13 namespace v8 {
14 namespace internal {
15 namespace wasm {
16
17 // Check if byte buffer contains a valid UTF8-encoded string.
18 // Returns true if multi-byte decoding succeeded and all decoded characters are
19 // valid character codepoints. Returns false otherwise.
20 bool IsValidUtf8(const uint8_t *buf, int32_t len);
21
22 } // namespace wasm
23 } // namespace internal
24 } // namespace v8
25
26 #endif // V8_WASM_UNICODE_H_
OLDNEW
« no previous file with comments | « src/wasm/module-decoder.cc ('k') | src/wasm/utf8.cc » ('j') | src/wasm/wasm-module.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698