Ignore:
Timestamp:
Jan 16, 2020, 9:26:21 AM (5 years ago)
Author:
[email protected]
Message:

operationToObject() should check for a null errorMessage.
https://bugs.webkit.org/show_bug.cgi?id=206339
<rdar://problem/58449666>

Reviewed by Yusuke Suzuki.

JSTests:

  • stress/operationToObject-should-check-for-null-errorMessage.js: Added.

Source/JavaScriptCore:

r224280 introduced operationToObject() with an option to specify a custom error
message. r254252 added a scenario where the passed in error message is null but
did not update operationToObject() to allow for this. This patch adds the
missing null check.

  • dfg/DFGOperations.cpp:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp

    r254632 r254687  
    456456
    457457    if (UNLIKELY(value.isUndefinedOrNull())) {
    458         if (errorMessage->length()) {
     458        if (errorMessage && errorMessage->length()) {
    459459            throwVMTypeError(globalObject, scope, errorMessage);
    460460            return nullptr;
Note: See TracChangeset for help on using the changeset viewer.