• Clemens Hammacher's avatar
    [wasm] Check for UTF-8 validity of section names · 81c7135c
    Clemens Hammacher authored
    According to the spec, section names must be valid UTF-8. This CL adds
    a check for that.
    Imported and exported names were already checked before.
    In order to use the {consume_string} function from the
    WasmSectionIterator, it moved it out of the ModuleDecoder into the
    anonymous namespace. It now also gets a name for the string to be
    parsed, for better error messages.
    
    R=rossberg@chromium.org
    
    Change-Id: I20b1ddb0bd1c7ada237d8303951073310fe1c714
    Reviewed-on: https://chromium-review.googlesource.com/470207
    Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
    Reviewed-by: 's avatarAndreas Rossberg <rossberg@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#44550}
    81c7135c
module-decoder.cc 48.2 KB