Bug 237185

Summary: Remove incorrect ASSERT.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, keith_miller, msaboff, saam, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed patch. ysuzuki: review+, ews-feeder: commit-queue-

Description Mark Lam 2022-02-24 23:19:02 PST
<rdar://problem/83902782>
Comment 1 Mark Lam 2022-02-24 23:40:10 PST
Created attachment 453178 [details]
proposed patch.
Comment 2 Keith Miller 2022-02-25 04:08:18 PST
Comment on attachment 453178 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=453178&action=review

> Source/JavaScriptCore/ChangeLog:10
> +        weren't sure that the StringImpl pointer can be null or not.  We're now certain

We should explain why/how the StringImpl can be null.
Comment 3 Mark Lam 2022-02-25 15:11:14 PST
(In reply to Keith Miller from comment #2)
> Comment on attachment 453178 [details]
> proposed patch.
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=453178&action=review
> 
> > Source/JavaScriptCore/ChangeLog:10
> > +        weren't sure that the StringImpl pointer can be null or not.  We're now certain
> 
> We should explain why/how the StringImpl can be null.

The ASSERT is from here:
```
    auto* impl = string->tryGetValueImpl();
    ASSERT(impl); // FIXME: rdar://83902782
    if (impl && impl->isAtom() && 
        ...
```

... where string is a JSString, which can also be a JSRopeString.

JSString::tryGetValueImpl() is:

```
inline const StringImpl* JSString::tryGetValueImpl() const
{
    uintptr_t pointer = fiberConcurrently();
    if (pointer & isRopeInPointer)
        return nullptr;
    return bitwise_cast<StringImpl*>(pointer);
}
```

Hence, if string is a JSRopeString, the implication can be null.
Comment 4 Mark Lam 2022-02-25 15:17:40 PST
> Hence, if string is a JSRopeString, the implication can be null.

/implication/impl/ ... sigh auto-correct.

Anyway, I'll add this info to the ChangeLog before landing.
Comment 5 Mark Lam 2022-02-25 15:20:42 PST
Landed in r290530: <http://trac.webkit.org/r290530>.