Changeset 196300 in webkit


Ignore:
Timestamp:
Feb 8, 2016 7:31:11 PM (8 years ago)
Author:
sbarati@apple.com
Message:

runtimeTypeForValue should protect against seeing TDZ value
https://bugs.webkit.org/show_bug.cgi?id=154023

Reviewed by Michael Saboff.

There are a few back traces I've seen from crashes that bottom out
inside runtimeTypeForValue. I haven't been able to reproduce
any such crash, but it's likely that we're encountering the
empty JSValue. It's better to just have this function protect
against seeing the empty value instead of dereferencing a null
pointer when it thinks the value is a cell.

  • runtime/RuntimeType.cpp:

(JSC::runtimeTypeForValue):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r196286 r196300  
     12016-02-08  Saam Barati  <sbarati@apple.com>
     2
     3        runtimeTypeForValue should protect against seeing TDZ value
     4        https://bugs.webkit.org/show_bug.cgi?id=154023
     5
     6        Reviewed by Michael Saboff.
     7
     8        There are a few back traces I've seen from crashes that bottom out
     9        inside runtimeTypeForValue. I haven't been able to reproduce
     10        any such crash, but it's likely that we're encountering the
     11        empty JSValue. It's better to just have this function protect
     12        against seeing the empty value instead of dereferencing a null
     13        pointer when it thinks the value is a cell.
     14
     15        * runtime/RuntimeType.cpp:
     16        (JSC::runtimeTypeForValue):
     17
    1182016-02-08  Andreas Kling  <akling@apple.com>
    219
  • trunk/Source/JavaScriptCore/runtime/RuntimeType.cpp

    r182114 r196300  
    11/*
    2  * Copyright (C) 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
    33 * Copyright (C) Saam Barati <saambarati1@gmail.com>. All rights reserved.
    44 *
     
    3636RuntimeType runtimeTypeForValue(JSValue value)
    3737{
     38    if (UNLIKELY(!value))
     39        return TypeNothing;
     40
    3841    if (value.isUndefined())
    3942        return TypeUndefined;
Note: See TracChangeset for help on using the changeset viewer.