Bug 247644

Summary: Segfault in JSC::IdentifierArena::makeBigIntDecimalIdentifier
Product: WebKit Reporter: David Degazio <d_degazio>
Component: JavaScriptCoreAssignee: David Degazio <d_degazio>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Reproducing case d_degazio: commit-queue-

Description David Degazio 2022-11-08 14:34:30 PST
Created attachment 463459 [details]
Reproducing case

The attached source fails with a segmentation fault when lexing the 0x1n bigint identifier. This seems to be because we use a JSBigInt value within the parser to handle converting non-decimal integer constants to decimal identifiers. When allocating this JSBigInt fails (in this case, because we have exhausted all memory in the previous invocation of foo), we try to throw an exception. In the lexer/parser however, there is no global object to throw an exception to, so the bigint implementation falls back to returning a null pointer, which causes the segfault when we use it later in makeBigIntDecimalIdentifier.

rdar://98566429
Comment 1 David Degazio 2022-11-08 15:11:34 PST
Pull request: https://github.com/WebKit/WebKit/pull/6271
Comment 2 EWS 2022-11-09 14:31:25 PST
Committed 256501@main (32b972813979): <https://commits.webkit.org/256501@main>

Reviewed commits have been landed. Closing PR #6271 and removing active labels.