Bug 218443 - [JSC] Remove compiler warning in LLIntData.cpp
Summary: [JSC] Remove compiler warning in LLIntData.cpp
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-11-02 06:32 PST by Xan Lopez
Modified: 2020-11-02 10:35 PST (History)
9 users (show)

See Also:


Attachments
Remove warning from LLIntData (3.65 KB, patch)
2020-11-02 06:40 PST, Xan Lopez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xan Lopez 2020-11-02 06:32:33 PST
This warning has been around in my machine for a while:

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/llint/LLIntCLoop.cpp:26,
                 from DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-6e4525b9-1.cpp:1:
../../Source/JavaScriptCore/llint/LLIntData.cpp: In static member function ‘static void JSC::LLInt::Data::performAssertions(JSC::VM&)’:
../../Source/JavaScriptCore/llint/LLIntData.cpp:100:88: warning: comparison of integer expressions of different signedness: ‘long unsigned int’ and ‘ptrdiff_t’ {aka ‘long int’} [-Wsign-compare]
  100 |     ASSERT(static_cast<long unsigned int>(CallFrameSlot::codeBlock * sizeof(Register)) == CallFrame::returnPCOffset() + MachineRegisterSize);
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DerivedSources/ForwardingHeaders/wtf/Assertions.h:346:11: note: in definition of macro ‘ASSERT’
  346 |     if (!(assertion)) { \
      |           ^~~~~~~~~


This seems fixable by casting the scoped enum used in this comparison (CallFrameSlot) to its underlying type, which seems advised in this kind of operation anyway. Also while at it I removed the type annotation for the enum, since we are using the default.
Comment 1 Xan Lopez 2020-11-02 06:40:35 PST
Created attachment 412915 [details]
Remove warning from LLIntData

v1
Comment 2 Radar WebKit Bug Importer 2020-11-02 10:07:15 PST
<rdar://problem/70955212>
Comment 3 Mark Lam 2020-11-02 10:19:15 PST
Comment on attachment 412915 [details]
Remove warning from LLIntData

r=me
Comment 4 EWS 2020-11-02 10:35:24 PST
Committed r269252: <https://trac.webkit.org/changeset/269252>

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