Bug 237185 - Remove incorrect ASSERT.
Summary: Remove incorrect ASSERT.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-02-24 23:19 PST by Mark Lam
Modified: 2022-02-25 15:38 PST (History)
7 users (show)

See Also:


Attachments
proposed patch. (2.43 KB, patch)
2022-02-24 23:40 PST, Mark Lam
ysuzuki: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>.