Changeset 293252 in webkit


Ignore:
Timestamp:
Apr 22, 2022 1:58:51 PM (3 months ago)
Author:
commit-queue@webkit.org
Message:

[JSC]Throw consistent exceptions for memory.init and memory.copy
https://bugs.webkit.org/show_bug.cgi?id=239592

Patch by Geza Lore <Geza Lore> on 2022-04-22
Reviewed by Yusuke Suzuki.

For a trapping Wasm memory.init and memory.copy instruction, the LLInt
used to throw OutOfBoundsMemoryAccess, but BBQ/OMG used to throw
OutOfBoundsTableAccess.

Changed BBQ/OMG to throw OutOfBoundsMemoryAccess as well.

  • wasm/WasmAirIRGenerator.cpp:

(JSC::Wasm::AirIRGenerator::addMemoryCopy):
(JSC::Wasm::AirIRGenerator::addMemoryInit):

  • wasm/WasmB3IRGenerator.cpp:

(JSC::Wasm::B3IRGenerator::addMemoryInit):
(JSC::Wasm::B3IRGenerator::addMemoryCopy):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r293220 r293252  
     12022-04-22  Geza Lore  <glore@igalia.com>
     2
     3        [JSC]Throw consistent exceptions for memory.init and memory.copy
     4        https://bugs.webkit.org/show_bug.cgi?id=239592
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        For a trapping Wasm memory.init and memory.copy instruction, the LLInt
     9        used to throw OutOfBoundsMemoryAccess, but BBQ/OMG used to throw
     10        OutOfBoundsTableAccess.
     11
     12        Changed BBQ/OMG to throw OutOfBoundsMemoryAccess as well.
     13
     14        * wasm/WasmAirIRGenerator.cpp:
     15        (JSC::Wasm::AirIRGenerator::addMemoryCopy):
     16        (JSC::Wasm::AirIRGenerator::addMemoryInit):
     17        * wasm/WasmB3IRGenerator.cpp:
     18        (JSC::Wasm::B3IRGenerator::addMemoryInit):
     19        (JSC::Wasm::B3IRGenerator::addMemoryCopy):
     20
    1212022-04-22  Mark Lam  <mark.lam@apple.com>
    222
  • trunk/Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp

    r292773 r293252  
    15551555        return Inst(BranchTest32, nullptr, Arg::resCond(MacroAssembler::Zero), result, result);
    15561556    }, [=, this] (CCallHelpers& jit, const B3::StackmapGenerationParams&) {
    1557         this->emitThrowException(jit, ExceptionType::OutOfBoundsTableAccess);
     1557        this->emitThrowException(jit, ExceptionType::OutOfBoundsMemoryAccess);
    15581558    });
    15591559
     
    15811581        return Inst(BranchTest32, nullptr, Arg::resCond(MacroAssembler::Zero), result, result);
    15821582    }, [=, this] (CCallHelpers& jit, const B3::StackmapGenerationParams&) {
    1583         this->emitThrowException(jit, ExceptionType::OutOfBoundsTableAccess);
     1583        this->emitThrowException(jit, ExceptionType::OutOfBoundsMemoryAccess);
    15841584    });
    15851585
  • trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp

    r292773 r293252  
    12501250
    12511251        check->setGenerator([=, this] (CCallHelpers& jit, const B3::StackmapGenerationParams&) {
    1252             this->emitExceptionCheck(jit, ExceptionType::OutOfBoundsTableAccess);
     1252            this->emitExceptionCheck(jit, ExceptionType::OutOfBoundsMemoryAccess);
    12531253        });
    12541254    }
     
    12701270
    12711271        check->setGenerator([=, this] (CCallHelpers& jit, const B3::StackmapGenerationParams&) {
    1272             this->emitExceptionCheck(jit, ExceptionType::OutOfBoundsTableAccess);
     1272            this->emitExceptionCheck(jit, ExceptionType::OutOfBoundsMemoryAccess);
    12731273        });
    12741274    }
Note: See TracChangeset for help on using the changeset viewer.