• Andreas Haas's avatar
    [wasm] Also kBadChar is a valid utf8 character · 8e0daf78
    Andreas Haas authored
    The validation of utf8 strings in WebAssembly modules used the character
    kBadChar = 0xFFFD to indicate a validation error. However, this
    character can appear in a valid utf8 string. This CL fixes this problem
    by duplicating some of the code in {Utf8::CalculateValue} and inlining
    it directly into Utf8::Validate. Note that Utf8::Validate is used only
    for WebAssembly.
    
    Tests for this change are in the WebAssembly spec tests, which I will
    update in a separate CL.
    
    R=vogelheim@chromium.org
    
    Change-Id: I8697b9299f3e98a8eafdf193bff8bdff90efd7dc
    Reviewed-on: https://chromium-review.googlesource.com/509534Reviewed-by: 's avatarDaniel Vogelheim <vogelheim@chromium.org>
    Commit-Queue: Andreas Haas <ahaas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#45476}
    8e0daf78
module-decoder.cc 52 KB