⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 245895 in webkit


Ignore:
Timestamp:
May 30, 2019, 11:06:09 AM (7 years ago)
Author:
Justin Michaud
Message:

oss-fuzz: jsc: Issue 15016: jsc: Abrt in JSC::Wasm::AirIRGenerator::addLocal (15016)
https://bugs.webkit.org/show_bug.cgi?id=198355

Reviewed by Saam Barati.

JSTests:

  • wasm/references/is_null.js:

Source/JavaScriptCore:

Fix missing anyref case in addLocal.

  • wasm/WasmAirIRGenerator.cpp:

(JSC::Wasm::AirIRGenerator::addLocal):

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r245888 r245895  
     12019-05-30  Justin Michaud  <justin_michaud@apple.com>
     2
     3        oss-fuzz: jsc: Issue 15016: jsc: Abrt in JSC::Wasm::AirIRGenerator::addLocal (15016)
     4        https://bugs.webkit.org/show_bug.cgi?id=198355
     5
     6        Reviewed by Saam Barati.
     7
     8        * wasm/references/is_null.js:
     9
    1102019-05-30  Stephan Szabo  <stephan.szabo@sony.com>
    211
  • trunk/JSTests/wasm/references/is_null.js

    r245496 r245895  
    1010          .Function("j")
    1111          .Function("k")
     12          .Function("local_read")
    1213      .End()
    1314      .Code()
    14         .Function("h", { params: ["anyref"], ret: "anyref" })
     15        .Function("h", { params: ["anyref"], ret: "anyref" }, ["anyref"])
    1516          .GetLocal(0)
     17          .SetLocal(1)
     18          .GetLocal(1)
    1619        .End()
    1720
     
    2831        .Function("k", { params: [], ret: "i32" })
    2932            .RefNull()
     33            .RefIsNull()
     34        .End()
     35
     36        .Function("local_read", { params: [], ret: "i32" }, ["anyref"])
     37            .GetLocal(0)
    3038            .RefIsNull()
    3139        .End()
     
    5260
    5361assert.eq(instance.exports.k(), 1)
     62assert.eq(instance.exports.local_read(), 1)
    5463
    5564assert.eq(obj.test, "hi")
  • trunk/Source/JavaScriptCore/ChangeLog

    r245875 r245895  
     12019-05-30  Justin Michaud  <justin_michaud@apple.com>
     2
     3        oss-fuzz: jsc: Issue 15016: jsc: Abrt in JSC::Wasm::AirIRGenerator::addLocal (15016)
     4        https://bugs.webkit.org/show_bug.cgi?id=198355
     5
     6        Reviewed by Saam Barati.
     7
     8        Fix missing anyref case in addLocal.
     9
     10        * wasm/WasmAirIRGenerator.cpp:
     11        (JSC::Wasm::AirIRGenerator::addLocal):
     12
    1132019-05-29  Don Olmstead  <don.olmstead@sony.com>
    214
  • trunk/Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp

    r245765 r245895  
    880880        m_locals.uncheckedAppend(local);
    881881        switch (type) {
     882        case Type::Anyref:
     883            append(Move, Arg::imm(JSValue::encode(jsNull())), local);
     884            break;
    882885        case Type::I32:
    883886        case Type::I64: {
  • trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp

    r245765 r245895  
    535535        Variable* local = m_proc.addVariable(toB3Type(type));
    536536        m_locals.uncheckedAppend(local);
    537         m_currentBlock->appendNew<VariableValue>(m_proc, Set, Origin(), local, constant(toB3Type(type), 0, Origin()));
     537        auto val = type == Anyref ? JSValue::encode(jsNull()) : 0;
     538        m_currentBlock->appendNew<VariableValue>(m_proc, Set, Origin(), local, constant(toB3Type(type), val, Origin()));
    538539    }
    539540    return { };
Note: See TracChangeset for help on using the changeset viewer.