• Clemens Backes's avatar
    [wasm] Pass correct code section start in streaming compilation · 7bace1d4
    Clemens Backes authored
    The streaming decoder computed the code section start from the passed
    "offset". That offset is computed from the module offset *after* the
    number of functions has been read. Hence 1 is subtracted, with the
    comment:
    // The offset passed to {ProcessCodeSectionHeader} is an error offset and
    // not the start offset of a buffer. Therefore we need the -1 here.
    
    That subtraction of 1 worked when the number of functions was encoded in
    a 1-byte LEB, otherwise it was off.
    
    This CL fixes the immediate issue of passing the right code offset. The
    usage of the previously existing offset also seems wrong, and I will try
    to clean that up in a follow-up CL.
    
    R=ahaas@chromium.org
    CC=szuend@chromium.org
    
    Bug: chromium:1150303
    Change-Id: I64bb2ececeb4749b7ba2096cd148ccb4079eca4f
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2562383
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#71503}
    7bace1d4
wasm-script-code-offset-streaming-expected.txt 617 Bytes