Changeset 239961 in webkit


Ignore:
Timestamp:
Jan 14, 2019 4:39:28 PM (5 years ago)
Author:
Caio Lima
Message:

[BigInt] Literal parsing is crashing when used inside a Object Literal
https://bugs.webkit.org/show_bug.cgi?id=193404

Reviewed by Yusuke Suzuki.

JSTests:

  • stress/big-int-literal-inside-literal-object.js: Added.

Source/JavaScriptCore:

Former implementation was relying into token.m_data.radix after the
call of next() into Parser.cpp. This is not safe because next
clobbers token.m_data.radix in some cases (e.g is CLOSEBRACE).
Now we get radix value before calling next() into parser and store
in a local variable.

  • parser/Parser.cpp:

(JSC::Parser<LexerType>::parsePrimaryExpression):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r239951 r239961  
     12019-01-14  Caio Lima  <ticaiolima@gmail.com>
     2
     3        [BigInt] Literal parsing is crashing when used inside a Object Literal
     4        https://bugs.webkit.org/show_bug.cgi?id=193404
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * stress/big-int-literal-inside-literal-object.js: Added.
     9
    1102019-01-14  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
    211
  • trunk/Source/JavaScriptCore/ChangeLog

    r239951 r239961  
     12019-01-14  Caio Lima  <ticaiolima@gmail.com>
     2
     3        [BigInt] Literal parsing is crashing when used inside a Object Literal
     4        https://bugs.webkit.org/show_bug.cgi?id=193404
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        Former implementation was relying into token.m_data.radix after the
     9        call of `next()` into Parser.cpp. This is not safe because next
     10        clobbers token.m_data.radix in some cases (e.g is CLOSEBRACE).
     11        Now we get radix value before calling `next()` into parser and store
     12        in a local variable.
     13
     14        * parser/Parser.cpp:
     15        (JSC::Parser<LexerType>::parsePrimaryExpression):
     16
    1172019-01-14  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
    218
  • trunk/Source/JavaScriptCore/parser/Parser.cpp

    r239774 r239961  
    45204520    case BIGINT: {
    45214521        const Identifier* ident = m_token.m_data.bigIntString;
     4522        uint8_t radix = m_token.m_data.radix;
    45224523        JSTokenLocation location(tokenLocation());
    45234524        next();
    4524         return context.createBigInt(location, ident, m_token.m_data.radix);
     4525        return context.createBigInt(location, ident, radix);
    45254526    }
    45264527    case STRING: {
Note: See TracChangeset for help on using the changeset viewer.