Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c2beca7a439f62be8619f7a86dbea17cecad5d14
      
https://github.com/WebKit/WebKit/commit/c2beca7a439f62be8619f7a86dbea17cecad5d14
  Author: Vassili Bykov <[email protected]>
  Date:   2026-07-31 (Fri, 31 Jul 2026)

  Changed paths:
    M Source/JavaScriptCore/parser/Lexer.cpp

  Log Message:
  -----------
  [JSC] Scan an int token in a single pass
https://bugs.webkit.org/show_bug.cgi?id=320708
rdar://183694790

Reviewed by Yusuke Suzuki.

On the fast path for scanning an int token, we scan a token it two passes. 
First we scan
the input to find the end of the token, then if the token is not too long, we 
scan it
again to accumulate the value. We can instead accumulate the value as we are 
scanning for
the end. The accumulated result will overflow on long tokens, but that's okay 
because we
only use it if the token is short.

The type of `result` is changed from signed to unsigned because a signed 
overflow is UB,
so with UBSan we would get false alarms on long int tokens.

* Source/JavaScriptCore/parser/Lexer.cpp:
(JSC::Lexer<T>::lexWithoutClearingLineTerminator):

Canonical link: https://commits.webkit.org/318347@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to