[Webkit-unassigned] [Bug 214809] New: -Wdeprecated-copy caused by DisallowVMEntry copy constructor

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jul 26 12:05:36 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=214809

            Bug ID: 214809
           Summary: -Wdeprecated-copy caused by DisallowVMEntry copy
                    constructor
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mcatanzaro at gnome.org
                CC: mark.lam at apple.com

Introduced by r264736:

[1651/4306] Building CXX object Source/WebCore/CMakeFiles...es/WebCore/unified-sources/UnifiedSource-68aea4ac-6.cpp.o
In file included from DerivedSources/ForwardingHeaders/wtf/Seconds.h:29,
                 from DerivedSources/ForwardingHeaders/wtf/WallTime.h:29,
                 from DerivedSources/ForwardingHeaders/wtf/ThreadingPrimitives.h:37,
                 from DerivedSources/ForwardingHeaders/wtf/MainThread.h:35,
                 from DerivedSources/ForwardingHeaders/wtf/NeverDestroyed.h:31,
                 from DerivedSources/ForwardingHeaders/wtf/text/AtomString.h:24,
                 from DerivedSources/ForwardingHeaders/wtf/text/WTFString.h:690,
                 from ../../Source/WebCore/dom/Exception.h:30,
                 from ../../Source/WebCore/dom/ExceptionOr.h:29,
                 from ../../Source/WebCore/bindings/js/JSDOMBinding.h:28,
                 from ../../Source/WebCore/bindings/js/JSDOMMapLike.h:28,
                 from ../../Source/WebCore/bindings/js/JSDOMMapLike.cpp:27,
                 from DerivedSources/WebCore/unified-sources/UnifiedSource-68aea4ac-6.cpp:1:
DerivedSources/ForwardingHeaders/wtf/Optional.h: In instantiation of ‘WTF::Optional< <template-parameter-1-1> >& WTF::Optional< <template-parameter-1-1> >::operator=(const WTF::Optional< <template-parameter-1-1> >&) [with T = JSC::DisallowVMEntryImpl<JSC::VM>]’:
DerivedSources/ForwardingHeaders/JavaScriptCore/PropertySlot.h:87:7:   required from here
DerivedSources/ForwardingHeaders/wtf/Optional.h:465:84: warning: implicitly-declared ‘constexpr JSC::DisallowVMEntryImpl<JSC::VM>& JSC::DisallowVMEntryImpl<JSC::VM>::operator=(const JSC::DisallowVMEntryImpl<JSC::VM>&)’ is deprecated [-Wdeprecated-copy]
  465 |     else if (initialized() == true  && rhs.initialized() == true)  contained_val() = *rhs;
      |                                                                    ~~~~~~~~~~~~~~~~^~~~~~
In file included from DerivedSources/ForwardingHeaders/JavaScriptCore/VM.h:38,
                 from DerivedSources/ForwardingHeaders/JavaScriptCore/Identifier.h:24,
                 from DerivedSources/WebCore/JSDOMBindingInternalsBuiltins.h:34,
                 from DerivedSources/WebCore/WebCoreJSBuiltinInternals.h:39,
                 from ../../Source/WebCore/bindings/js/JSDOMGlobalObject.h:29,
                 from ../../Source/WebCore/bindings/js/DOMWrapperWorld.h:24,
                 from ../../Source/WebCore/bindings/js/JSDOMWrapperCache.h:26,
                 from ../../Source/WebCore/bindings/js/JSDOMBinding.h:29,
                 from ../../Source/WebCore/bindings/js/JSDOMMapLike.h:28,
                 from ../../Source/WebCore/bindings/js/JSDOMMapLike.cpp:27,
                 from DerivedSources/WebCore/unified-sources/UnifiedSource-68aea4ac-6.cpp:1:
DerivedSources/ForwardingHeaders/JavaScriptCore/DisallowVMEntry.h:46:5: note: because ‘JSC::DisallowVMEntryImpl<JSC::VM>’ has user-provided ‘JSC::DisallowVMEntryImpl<VMType>::DisallowVMEntryImpl(const JSC::DisallowVMEntryImpl<VMType>&) [with VMType = JSC::VM]’
   46 |     DisallowVMEntryImpl(const DisallowVMEntryImpl& other)
      |     ^~~~~~~~~~~~~~~~~~~

Problem is the code makes a copy of the DisallowVMEntryImpl, and this copy fails to increment the VM's disallowVMEntryCount. But disallowVMEntryCount will be decremented when the DisallowVMEntryImpl is destroyed. ***I think that results in underflow.***

Let's add a copy constructor.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200726/7b7def12/attachment.htm>


More information about the webkit-unassigned mailing list