Bug 214298

Summary: [JSC] Remove compiler warning in JSBigInt
Product: WebKit Reporter: Xan Lopez <xan.lopez>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, keith_miller, mark.lam, msaboff, saam, sam, tzagallo, webkit-bug-importer, xan.lopez
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Remove warning in JSBigInt none

Description Xan Lopez 2020-07-14 02:27:59 PDT
We are ASSERTing >= 0 with an unsigned int, which is redundant. This has been around for a while.

[120/188] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore...DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f2e18ffc-17.cpp.o
In file included from DerivedSources/ForwardingHeaders/wtf/StdLibExtras.h:32,
                 from DerivedSources/ForwardingHeaders/wtf/FastMalloc.h:26,
                 from ../../Source/JavaScriptCore/config.h:38,
                 from ../../Source/JavaScriptCore/runtime/JSAsyncGenerator.cpp:26,
                 from DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f2e18ffc-17.cpp:1:
../../Source/JavaScriptCore/runtime/JSBigInt.cpp: In instantiation of ‘static JSC::JSValue JSC::JSBigInt::parseInt(JSC::JSGlobalObject*, JSC::VM&, CharType*, unsigned int, unsigned int, unsigned int, JSC::JSBigInt::ErrorParseMode, JSC::JSBigInt::ParseIntSign, JSC::JSBigInt::ParseIntMode) [with CharType = const unsigned char]’:
../../Source/JavaScriptCore/runtime/JSBigInt.cpp:329:145:   required from here
../../Source/JavaScriptCore/runtime/JSBigInt.cpp:2422:19: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits]
 2422 |     ASSERT(length >= 0);
DerivedSources/ForwardingHeaders/wtf/Assertions.h:346:11: note: in definition of macro ‘ASSERT’
  346 |     if (!(assertion)) { \
      |           ^~~~~~~~~
Comment 1 Xan Lopez 2020-07-14 02:29:21 PDT
Created attachment 404217 [details]
Remove warning in JSBigInt

Remove warning.
Comment 2 EWS 2020-07-14 09:55:26 PDT
Committed r264346: <https://trac.webkit.org/changeset/264346>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 404217 [details].
Comment 3 Radar WebKit Bug Importer 2020-07-14 09:56:19 PDT
<rdar://problem/65548727>