• Clemens Hammacher's avatar
    [wasm] Refactor and fix ErrorThrower · e3207836
    Clemens Hammacher authored
    The error thrower did allocate the exception at the moment the error was
    detected. For async compilation, this meant in another step than when
    it was actually thrown. Since the HandleScope of the exception already
    died at that point, this would have lead to memory errors.
    
    With this refactoring, we only store the information needed to generate
    the exception in the ErrorThrower, and only generate the exception
    object once it is actually needed.
    
    With regression test.
    
    R=ahaas@chromium.org, mtrofin@chromium.org
    Also-by: ahaas@chromium.org
    
    Change-Id: Iffcab1f8d1cf5925e3643fcf0729ba9a84c7d277
    Reviewed-on: https://chromium-review.googlesource.com/490085
    Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
    Reviewed-by: 's avatarMircea Trofin <mtrofin@chromium.org>
    Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#45000}
    e3207836
wasm-result.cc 4.27 KB