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

Changeset 254244 in webkit


Ignore:
Timestamp:
Jan 8, 2020, 6:04:19 PM (7 years ago)
Author:
msaboff@apple.com
Message:

Instruction.h: Multiplication result converted to larger type
​https://bugs.webkit.org/show_bug.cgi?id=205945

Reviewed by Mark Lam.

  • bytecode/Instruction.h:

(JSC::BaseInstruction::size const):
Changed the types to size_t so that the computation is computed accordingly.

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r254241 r254244  
     12020-01-08  Michael Saboff  <msaboff@apple.com>
     2
     3        Instruction.h: Multiplication result converted to larger type
     4        https://bugs.webkit.org/show_bug.cgi?id=205945
     5
     6        Reviewed by Mark Lam.
     7
     8        * bytecode/Instruction.h:
     9        (JSC::BaseInstruction::size const):
     10        Changed the types to size_t so that the computation is computed accordingly.
     11
     12
    1132020-01-08  Yusuke Suzuki  <ysuzuki@apple.com>
    214
  • trunk/Source/JavaScriptCore/bytecode/Instruction.h

    r253904 r254244  
    119119    {
    120120        auto sizeShiftAmount = this->sizeShiftAmount<Traits>();
    121         auto prefixSize = sizeShiftAmount ? 1 : 0;
    122         auto operandSize = 1 << sizeShiftAmount;
     121        size_t prefixSize = sizeShiftAmount ? 1 : 0;
     122        size_t operandSize = static_cast<size_t>(1) << sizeShiftAmount;
    123123        size_t sizeOfBytecode = 1;
    124124        return sizeOfBytecode + (Traits::opcodeLengths[opcodeID<Traits>()] - 1) * operandSize + prefixSize;
Note: See TracChangeset for help on using the changeset viewer.