Bug 234989 - WebKit::nsTextAlignmentFromTextAlignment() falls through ASSERT_NOT_REACHED()
Summary: WebKit::nsTextAlignmentFromTextAlignment() falls through ASSERT_NOT_REACHED()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on: 234932
Blocks:
  Show dependency treegraph
 
Reported: 2022-01-07 14:41 PST by David Kilzer (:ddkilzer)
Modified: 2022-01-19 14:21 PST (History)
4 users (show)

See Also:


Attachments
Patch (2.13 KB, patch)
2022-01-19 10:51 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2022-01-07 14:41:33 PST
WebKit::nsTextAlignmentFromTextAlignment() falls through ASSERT_NOT_REACHED().

In the `default` case, `nsTextAlignment` is returned uninitialized.

static NSTextAlignment nsTextAlignmentFromTextAlignment(TextAlignment textAlignment)
{   
    NSTextAlignment nsTextAlignment;
    switch (textAlignment) {
    case NoAlignment:
        nsTextAlignment = NSTextAlignmentNatural;
        break;
    case LeftAlignment: 
        nsTextAlignment = NSTextAlignmentLeft;
        break;
    case RightAlignment:
        nsTextAlignment = NSTextAlignmentRight;
        break;
    case CenterAlignment: 
        nsTextAlignment = NSTextAlignmentCenter;
        break;
    case JustifiedAlignment:
        nsTextAlignment = NSTextAlignmentJustified;
        break;
    default:
        ASSERT_NOT_REACHED();
    }
    
    return nsTextAlignment;
}

See Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm.
Comment 1 Radar WebKit Bug Importer 2022-01-07 14:41:59 PST
<rdar://problem/87273264>
Comment 2 Chris Dumez 2022-01-19 10:51:12 PST
Created attachment 449494 [details]
Patch
Comment 3 EWS 2022-01-19 14:21:48 PST
Committed r288241 (246195@main): <https://commits.webkit.org/246195@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 449494 [details].