Changeset 258478 in webkit
- Timestamp:
- Mar 15, 2020 3:16:52 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/PerformanceTests/ChangeLog
r256731 r258478 1 2020-03-15 Yusuke Suzuki <ysuzuki@apple.com> 2 3 Should not use variable-length-array (VLA) 4 https://bugs.webkit.org/show_bug.cgi?id=209043 5 6 Reviewed by Mark Lam. 7 8 * MediaTime/Configurations/Base.xcconfig: 9 1 10 2020-02-17 Don Olmstead <don.olmstead@sony.com> 2 11 -
trunk/PerformanceTests/MediaTime/Configurations/Base.xcconfig
r257755 r258478 83 83 GCC_WARN_UNUSED_VARIABLE = YES; 84 84 PREBINDING = NO; 85 WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough ;85 WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough -Wvla; 86 86 HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include $(DSTROOT)/usr/local/include icu $(HEADER_SEARCH_PATHS); 87 87 -
trunk/Source/JavaScriptCore/API/JSContext.mm
r251425 r258478 233 233 JSContext *context = [JSContext currentContext]; 234 234 size_t count = entry->argumentCount; 235 JSValue * argumentArray[count];236 for (size_t i = 0; i < count; ++i)237 argumentArray[i] = [JSValue valueWithJSValueRef:entry->arguments[i] inContext:context];238 entry->currentArguments = [[NSArray alloc] initWithObjects:argumentArray count:count];235 NSMutableArray *arguments = [[NSMutableArray alloc] initWithCapacity:count]; 236 for (size_t i = 0; i < count; ++i) 237 [arguments setObject:[JSValue valueWithJSValueRef:entry->arguments[i] inContext:context] atIndexedSubscript:i]; 238 entry->currentArguments = arguments; 239 239 } 240 240 -
trunk/Source/JavaScriptCore/API/JSValue.mm
r251425 r258478 37 37 #import "JSValuePrivate.h" 38 38 #import "JSWrapperMap.h" 39 #import "MarkedJSValueRefArray.h" 39 40 #import "ObjcRuntimeExtras.h" 40 41 #import "JSCInlines.h" … … 473 474 - (JSValue *)callWithArguments:(NSArray *)argumentArray 474 475 { 476 JSC::JSGlobalObject* globalObject = toJS([_context JSGlobalContextRef]); 477 JSC::VM& vm = globalObject->vm(); 478 JSC::JSLockHolder locker(vm); 479 475 480 NSUInteger argumentCount = [argumentArray count]; 476 JS ValueRef arguments[argumentCount];481 JSC::MarkedJSValueRefArray arguments([_context JSGlobalContextRef], argumentCount); 477 482 for (unsigned i = 0; i < argumentCount; ++i) 478 483 arguments[i] = objectToValue(_context, [argumentArray objectAtIndex:i]); … … 483 488 return [_context valueFromNotifyException:exception]; 484 489 485 JSValueRef result = JSObjectCallAsFunction([_context JSGlobalContextRef], object, 0, argumentCount, arguments , &exception);490 JSValueRef result = JSObjectCallAsFunction([_context JSGlobalContextRef], object, 0, argumentCount, arguments.data(), &exception); 486 491 if (exception) 487 492 return [_context valueFromNotifyException:exception]; … … 492 497 - (JSValue *)constructWithArguments:(NSArray *)argumentArray 493 498 { 499 JSC::JSGlobalObject* globalObject = toJS([_context JSGlobalContextRef]); 500 JSC::VM& vm = globalObject->vm(); 501 JSC::JSLockHolder locker(vm); 502 494 503 NSUInteger argumentCount = [argumentArray count]; 495 JS ValueRef arguments[argumentCount];504 JSC::MarkedJSValueRefArray arguments([_context JSGlobalContextRef], argumentCount); 496 505 for (unsigned i = 0; i < argumentCount; ++i) 497 506 arguments[i] = objectToValue(_context, [argumentArray objectAtIndex:i]); … … 502 511 return [_context valueFromNotifyException:exception]; 503 512 504 JSObjectRef result = JSObjectCallAsConstructor([_context JSGlobalContextRef], object, argumentCount, arguments , &exception);513 JSObjectRef result = JSObjectCallAsConstructor([_context JSGlobalContextRef], object, argumentCount, arguments.data(), &exception); 505 514 if (exception) 506 515 return [_context valueFromNotifyException:exception]; … … 511 520 - (JSValue *)invokeMethod:(NSString *)method withArguments:(NSArray *)arguments 512 521 { 522 JSC::JSGlobalObject* globalObject = toJS([_context JSGlobalContextRef]); 523 JSC::VM& vm = globalObject->vm(); 524 JSC::JSLockHolder locker(vm); 525 513 526 NSUInteger argumentCount = [arguments count]; 514 JS ValueRef argumentArray[argumentCount];527 JSC::MarkedJSValueRefArray argumentArray([_context JSGlobalContextRef], argumentCount); 515 528 for (unsigned i = 0; i < argumentCount; ++i) 516 529 argumentArray[i] = objectToValue(_context, [arguments objectAtIndex:i]); … … 530 543 return [_context valueFromNotifyException:exception]; 531 544 532 JSValueRef result = JSObjectCallAsFunction([_context JSGlobalContextRef], object, thisObject, argumentCount, argumentArray , &exception);545 JSValueRef result = JSObjectCallAsFunction([_context JSGlobalContextRef], object, thisObject, argumentCount, argumentArray.data(), &exception); 533 546 if (exception) 534 547 return [_context valueFromNotifyException:exception]; -
trunk/Source/JavaScriptCore/API/tests/minidom.c
r245430 r258478 89 89 JSStringRef string = JSValueToStringCopy(context, arguments[0], exception); 90 90 size_t numChars = JSStringGetMaximumUTF8CStringSize(string); 91 char stringUTF8[numChars];91 char* stringUTF8 = (char*)malloc(numChars); 92 92 JSStringGetUTF8CString(string, stringUTF8, numChars); 93 93 printf("%s\n", stringUTF8); 94 94 JSStringRelease(string); 95 free(stringUTF8); 95 96 } 96 97 -
trunk/Source/JavaScriptCore/API/tests/testapi.cpp
r253236 r258478 30 30 #include "JSGlobalObjectInlines.h" 31 31 #include "JSObject.h" 32 #include "MarkedJSValueRefArray.h" 32 33 33 34 #include <JavaScriptCore/JSContextRefPrivate.h> … … 43 44 extern "C" void configureJSCForTesting(); 44 45 extern "C" int testCAPIViaCpp(const char* filter); 46 extern "C" void JSSynchronousGarbageCollectForDebugging(JSContextRef); 45 47 46 48 class APIString { … … 145 147 void promiseEarlyHandledRejections(); 146 148 void topCallFrameAccess(); 149 void markedJSValueArrayAndGC(); 147 150 148 151 int failed() const { return m_failed; } … … 621 624 } 622 625 626 void TestAPI::markedJSValueArrayAndGC() 627 { 628 auto testMarkedJSValueArray = [&](unsigned count) { 629 auto* globalObject = toJS(context); 630 JSC::JSLockHolder locker(globalObject->vm()); 631 JSC::MarkedJSValueRefArray values(context, count); 632 for (unsigned index = 0; index < count; ++index) { 633 String target = makeString("Prefix", index); 634 auto holder = OpaqueJSString::tryCreate(target); 635 JSValueRef string = JSValueMakeString(context, holder.get()); 636 values[index] = string; 637 } 638 JSSynchronousGarbageCollectForDebugging(context); 639 bool ok = true; 640 for (unsigned index = 0; index < count; ++index) { 641 String target = makeString("Prefix", index); 642 auto holder = OpaqueJSString::tryCreate(target); 643 JSValueRef string = JSValueMakeString(context, holder.get()); 644 if (!JSValueIsStrictEqual(context, values[index], string)) 645 ok = false; 646 } 647 check(ok, "Held JSString should be alive and correct."); 648 }; 649 testMarkedJSValueArray(4); 650 testMarkedJSValueArray(1000); 651 } 652 623 653 void configureJSCForTesting() 624 654 { … … 660 690 RUN(promiseUnhandledRejectionFromUnhandledRejectionCallback()); 661 691 RUN(promiseEarlyHandledRejections()); 692 RUN(markedJSValueArrayAndGC()); 662 693 663 694 if (tasks.isEmpty()) { -
trunk/Source/JavaScriptCore/ChangeLog
r258463 r258478 1 2020-03-15 Yusuke Suzuki <ysuzuki@apple.com> 2 3 Should not use variable-length-array (VLA) 4 https://bugs.webkit.org/show_bug.cgi?id=209043 5 6 Reviewed by Mark Lam. 7 8 This patch disables variable-length-array (VLA). If this feature uses user-input, user can 9 control the stack height consumed by C++ code. This patch avoids using VLA. To achieve that, 10 11 1. We set `-Wvla` warning option to trigger warnings if it is used. 12 2. Introduce MarkedJSValueRefArray for API. This replaces `JSValueRef arguments[variableLength]` use case. 13 MarkedJSValueRefArray registers itself to JSC GC so that GC can mark it as a strong root. 14 15 * API/JSContext.mm: 16 (+[JSContext currentArguments]): 17 * API/JSValue.mm: 18 (-[JSValue callWithArguments:]): 19 (-[JSValue constructWithArguments:]): 20 (-[JSValue invokeMethod:withArguments:]): 21 * API/MarkedJSValueRefArray.cpp: Added. 22 (JSC::MarkedJSValueRefArray::MarkedJSValueRefArray): 23 (JSC::MarkedJSValueRefArray::~MarkedJSValueRefArray): 24 (JSC::MarkedJSValueRefArray::visitAggregate): 25 * API/MarkedJSValueRefArray.h: Added. 26 * API/tests/minidom.c: 27 (print): 28 * API/tests/testapi.cpp: 29 (TestAPI::markedJSValueArrayAndGC): 30 (testCAPIViaCpp): 31 * Configurations/Base.xcconfig: 32 * JavaScriptCore.xcodeproj/project.pbxproj: 33 * Sources.txt: 34 * heap/Heap.cpp: 35 (JSC::Heap::addCoreConstraints): 36 (JSC::Heap::addMarkedJSValueRefArray): 37 * heap/Heap.h: 38 * heap/MarkedSpace.h: 39 (JSC::MarkedSpace::activeWeakSetsBegin): Deleted. 40 (JSC::MarkedSpace::activeWeakSetsEnd): Deleted. 41 (JSC::MarkedSpace::newActiveWeakSetsBegin): Deleted. 42 (JSC::MarkedSpace::newActiveWeakSetsEnd): Deleted. 43 * runtime/ArgList.h: 44 1 45 2020-03-14 Saam Barati <sbarati@apple.com> 2 46 -
trunk/Source/JavaScriptCore/Configurations/Base.xcconfig
r257755 r258478 99 99 CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 100 100 PREBINDING = NO; 101 WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wconditional-uninitialized -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough ;101 WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wconditional-uninitialized -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough -Wvla; 102 102 103 103 HEADER_SEARCH_PATHS = . "${BUILT_PRODUCTS_DIR}/usr/local/include" $(HEADER_SEARCH_PATHS); -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r258344 r258478 1850 1850 E3C8ED4323A1DBCB00131958 /* IsoInlinedHeapCellType.h in Headers */ = {isa = PBXBuildFile; fileRef = E3C8ED4223A1DBC500131958 /* IsoInlinedHeapCellType.h */; }; 1851 1851 E3D239C91B829C1C00BBEF67 /* JSModuleEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = E3D239C71B829C1C00BBEF67 /* JSModuleEnvironment.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1852 E3D3515F241B89D7008DC16E /* MarkedJSValueRefArray.h in Headers */ = {isa = PBXBuildFile; fileRef = E3D3515D241B89CE008DC16E /* MarkedJSValueRefArray.h */; }; 1852 1853 E3D877741E65C0A000BE945A /* BytecodeDumper.h in Headers */ = {isa = PBXBuildFile; fileRef = E3D877721E65C08900BE945A /* BytecodeDumper.h */; }; 1853 1854 E3EE137621FBD43500D83C4B /* ErrorType.h in Headers */ = {isa = PBXBuildFile; fileRef = E3EE137421FBD43400D83C4B /* ErrorType.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 5027 5028 E3D264291D38C042000BE174 /* BytecodeRewriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BytecodeRewriter.cpp; sourceTree = "<group>"; }; 5028 5029 E3D2642A1D38C042000BE174 /* BytecodeRewriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BytecodeRewriter.h; sourceTree = "<group>"; }; 5030 E3D3515D241B89CE008DC16E /* MarkedJSValueRefArray.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MarkedJSValueRefArray.h; sourceTree = "<group>"; }; 5031 E3D3515E241B89CF008DC16E /* MarkedJSValueRefArray.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MarkedJSValueRefArray.cpp; sourceTree = "<group>"; }; 5029 5032 E3D877711E65C08900BE945A /* BytecodeDumper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BytecodeDumper.cpp; sourceTree = "<group>"; }; 5030 5033 E3D877721E65C08900BE945A /* BytecodeDumper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BytecodeDumper.h; sourceTree = "<group>"; }; … … 6412 6415 86E3C60C167BAB87006D760A /* JSWrapperMap.h */, 6413 6416 86E3C60B167BAB87006D760A /* JSWrapperMap.mm */, 6417 E3D3515E241B89CF008DC16E /* MarkedJSValueRefArray.cpp */, 6418 E3D3515D241B89CE008DC16E /* MarkedJSValueRefArray.h */, 6414 6419 86F3EEB9168CCF750077B92A /* ObjCCallbackFunction.h */, 6415 6420 86F3EEBA168CCF750077B92A /* ObjCCallbackFunction.mm */, … … 9964 9969 0F7C5FB81D888A0C0044F5E2 /* MarkedBlockInlines.h in Headers */, 9965 9970 141448CB13A176EC00F5BA1A /* MarkedBlockSet.h in Headers */, 9971 E3D3515F241B89D7008DC16E /* MarkedJSValueRefArray.h in Headers */, 9966 9972 14D2F3DB139F4BE200491031 /* MarkedSpace.h in Headers */, 9967 9973 0F7DF1351E2970DC0095951B /* MarkedSpaceInlines.h in Headers */, -
trunk/Source/JavaScriptCore/Sources.txt
r258344 r258478 41 41 API/JSWeakPrivate.cpp 42 42 API/JSWeakValue.cpp 43 API/MarkedJSValueRefArray.cpp 43 44 API/OpaqueJSString.cpp 44 45 -
trunk/Source/JavaScriptCore/heap/Heap.cpp
r258344 r258478 59 59 #include "MachineStackMarker.h" 60 60 #include "MarkStackMergingConstraint.h" 61 #include "MarkedJSValueRefArray.h" 61 62 #include "MarkedSpaceInlines.h" 62 63 #include "MarkingConstraintSet.h" … … 2759 2760 } 2760 2761 2762 m_markedJSValueRefArrays.forEach([&] (MarkedJSValueRefArray* array) { 2763 array->visitAggregate(slotVisitor); 2764 }); 2765 2761 2766 { 2762 2767 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::VMExceptions); … … 3003 3008 } 3004 3009 3010 3011 void Heap::addMarkedJSValueRefArray(MarkedJSValueRefArray* array) 3012 { 3013 m_markedJSValueRefArrays.append(array); 3014 } 3015 3005 3016 void Heap::runTaskInParallel(RefPtr<SharedTask<void(SlotVisitor&)>> task) 3006 3017 { -
trunk/Source/JavaScriptCore/heap/Heap.h
r254087 r258478 74 74 class MarkStackArray; 75 75 class MarkStackMergingConstraint; 76 class MarkedJSValueRefArray; 76 77 class BlockDirectory; 77 78 class MarkedArgumentBuffer; … … 241 242 242 243 HashSet<MarkedArgumentBuffer*>& markListSet(); 244 void addMarkedJSValueRefArray(MarkedJSValueRefArray*); 243 245 244 246 template<typename Functor> void forEachProtectedCell(const Functor&); … … 618 620 ProtectCountSet m_protectedValues; 619 621 std::unique_ptr<HashSet<MarkedArgumentBuffer*>> m_markListSet; 622 SentinelLinkedList<MarkedJSValueRefArray, BasicRawSentinelNode<MarkedJSValueRefArray>> m_markedJSValueRefArrays; 620 623 621 624 std::unique_ptr<MachineThreads> m_machineThreads; -
trunk/Source/JavaScriptCore/heap/MarkedSpace.h
r252452 r258478 174 174 bool isMarking() const { return m_isMarking; } 175 175 176 WeakSet* activeWeakSetsBegin() { return m_activeWeakSets.begin(); }177 WeakSet* activeWeakSetsEnd() { return m_activeWeakSets.end(); }178 WeakSet* newActiveWeakSetsBegin() { return m_newActiveWeakSets.begin(); }179 WeakSet* newActiveWeakSetsEnd() { return m_newActiveWeakSets.end(); }180 181 176 void dumpBits(PrintStream& = WTF::dataFile()); 182 177 -
trunk/Source/JavaScriptCore/runtime/ArgList.h
r254735 r258478 37 37 public: 38 38 using Base = RecordOverflow; 39 static const size_t inlineCapacity = 8;39 static constexpr size_t inlineCapacity = 8; 40 40 typedef HashSet<MarkedArgumentBuffer*> ListSet; 41 41 -
trunk/Source/WTF/ChangeLog
r258447 r258478 1 2020-03-15 Yusuke Suzuki <ysuzuki@apple.com> 2 3 Should not use variable-length-array (VLA) 4 https://bugs.webkit.org/show_bug.cgi?id=209043 5 6 Reviewed by Mark Lam. 7 8 * Configurations/Base.xcconfig: 9 * wtf/UUID.cpp: 10 (WTF::bootSessionUUIDString): 11 1 12 2020-03-13 Myles C. Maxfield <mmaxfield@apple.com> 2 13 -
trunk/Source/WTF/Configurations/Base.xcconfig
r257755 r258478 98 98 GCC_WARN_UNUSED_VARIABLE = YES; 99 99 PREBINDING = NO; 100 WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wconditional-uninitialized -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough ;100 WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wconditional-uninitialized -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough -Wvla; 101 101 HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)$(WTF_INSTALL_PATH_PREFIX)/usr/local/include $(DSTROOT)$(WTF_INSTALL_PATH_PREFIX)/usr/local/include $(inherited); 102 102 SYSTEM_HEADER_SEARCH_PATHS = $(SDK_DIR)$(WTF_INSTALL_PATH_PREFIX)/usr/local/include $(inherited); -
trunk/Source/WTF/wtf/UUID.cpp
r256030 r258478 71 71 static std::once_flag onceKey; 72 72 std::call_once(onceKey, [] { 73 size_t uuidLength = 37; 74 char uuid[uuidLength]; 73 constexpr size_t maxUUIDLength = 37; 74 char uuid[maxUUIDLength]; 75 size_t uuidLength = maxUUIDLength; 75 76 if (sysctlbyname("kern.bootsessionuuid", uuid, &uuidLength, nullptr, 0)) 76 77 return; -
trunk/Source/WebCore/ChangeLog
r258476 r258478 1 2020-03-15 Yusuke Suzuki <ysuzuki@apple.com> 2 3 Should not use variable-length-array (VLA) 4 https://bugs.webkit.org/show_bug.cgi?id=209043 5 6 Reviewed by Mark Lam. 7 8 * Configurations/Base.xcconfig: 9 * crypto/mac/SerializedCryptoKeyWrapMac.mm: 10 (WebCore::wrapSerializedCryptoKey): 11 (WebCore::unwrapSerializedCryptoKey): 12 * html/canvas/WebGL2RenderingContext.cpp: 13 (WebCore::WebGL2RenderingContext::getInternalformatParameter): 14 * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp: 15 (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices): 16 * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm: 17 (WebCore::updateDisplayID): 18 (WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDevices): 19 1 20 2020-03-14 Brent Fulgham <bfulgham@apple.com> 2 21 -
trunk/Source/WebCore/Configurations/Base.xcconfig
r257755 r258478 89 89 GCC_WARN_UNUSED_FUNCTION = YES; 90 90 GCC_WARN_UNUSED_VARIABLE = YES; 91 WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wconditional-uninitialized -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough -W no-unknown-warning-option;91 WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wconditional-uninitialized -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough -Wvla -Wno-unknown-warning-option; 92 92 93 93 TARGET_MAC_OS_X_VERSION_MAJOR = $(TARGET_MAC_OS_X_VERSION_MAJOR$(MACOSX_DEPLOYMENT_TARGET:suffix:identifier)); -
trunk/Source/WebCore/PAL/ChangeLog
r258359 r258478 1 2020-03-15 Yusuke Suzuki <ysuzuki@apple.com> 2 3 Should not use variable-length-array (VLA) 4 https://bugs.webkit.org/show_bug.cgi?id=209043 5 6 Reviewed by Mark Lam. 7 8 * Configurations/Base.xcconfig: 9 1 10 2020-03-12 Per Arne Vollan <pvollan@apple.com> 2 11 -
trunk/Source/WebCore/PAL/Configurations/Base.xcconfig
r257755 r258478 89 89 GCC_WARN_UNUSED_FUNCTION = YES; 90 90 GCC_WARN_UNUSED_VARIABLE = YES; 91 WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wconditional-uninitialized -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough -W no-unknown-warning-option;91 WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wconditional-uninitialized -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough -Wvla -Wno-unknown-warning-option; 92 92 93 93 TARGET_MAC_OS_X_VERSION_MAJOR = $(TARGET_MAC_OS_X_VERSION_MAJOR$(MACOSX_DEPLOYMENT_TARGET:suffix:identifier)); -
trunk/Source/WebCore/crypto/mac/SerializedCryptoKeyWrapMac.mm
r247117 r258478 221 221 222 222 Vector<uint8_t> encryptedKey(key.size()); 223 size_t tagLength = 16; 224 uint8_t tag[tagLength]; 223 constexpr size_t maxTagLength = 16; 224 size_t tagLength = maxTagLength; 225 uint8_t tag[maxTagLength]; 225 226 226 227 ALLOW_DEPRECATED_DECLARATIONS_BEGIN … … 288 289 kek.shrink(kekSize); 289 290 290 size_t tagLength = 16; 291 uint8_t actualTag[tagLength]; 291 constexpr size_t maxTagLength = 16; 292 size_t tagLength = maxTagLength; 293 uint8_t actualTag[maxTagLength]; 292 294 293 295 key.resize(encryptedKey.size()); -
trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp
r257799 r258478 394 394 m_context->getInternalformativ(target, internalformat, GraphicsContextGL::NUM_SAMPLE_COUNTS, 1, &numValues); 395 395 396 GCGLint params[numValues];397 m_context->getInternalformativ(target, internalformat, pname, numValues, params );396 Vector<GCGLint> params(numValues); 397 m_context->getInternalformativ(target, internalformat, pname, numValues, params.data()); 398 398 #else 399 399 // On desktop OpenGL 4.1 or below we must emulate glGetInternalformativ. … … 424 424 // the value of GL_NUM_SAMPLE_COUNTS will be zero for such formats. 425 425 numValues = isIntegerFormat(internalformat) ? 0 : samples.size(); 426 GCGLint params[numValues];426 Vector<GCGLint> params(numValues); 427 427 for (size_t i = 0; i < static_cast<size_t>(numValues); ++i) 428 428 params[i] = samples[i]; 429 429 #endif 430 430 431 return Int32Array::tryCreate(params , numValues);431 return Int32Array::tryCreate(params.data(), numValues); 432 432 } 433 433 -
trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp
r251992 r258478 168 168 169 169 size_t deviceCount = dataSize / sizeof(AudioObjectID); 170 AudioObjectID deviceIDs[deviceCount];171 err = AudioObjectGetPropertyData(kAudioObjectSystemObject, &address, 0, nullptr, &dataSize, deviceIDs );170 Vector<AudioObjectID> deviceIDs(deviceCount); 171 err = AudioObjectGetPropertyData(kAudioObjectSystemObject, &address, 0, nullptr, &dataSize, deviceIDs.data()); 172 172 if (err) { 173 173 LOG(Media, "CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices(%p) failed to get device list %d (%.4s)", this, (int)err, (char*)&err); -
trunk/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm
r248190 r258478 63 63 } 64 64 65 CGDirectDisplayID activeDisplays[displayCount];66 err = CGGetActiveDisplayList(displayCount, &(activeDisplays[0]), &displayCount);65 Vector<CGDirectDisplayID> activeDisplays(displayCount); 66 err = CGGetActiveDisplayList(displayCount, activeDisplays.data(), &displayCount); 67 67 if (err) { 68 68 RELEASE_LOG(Media, "CGGetActiveDisplayList() returned error %d when trying to get the active display list", static_cast<int>(err)); … … 320 320 } 321 321 322 CGDirectDisplayID activeDisplays[displayCount];323 err = CGGetActiveDisplayList(displayCount, &(activeDisplays[0]), &displayCount);322 Vector<CGDirectDisplayID> activeDisplays(displayCount); 323 err = CGGetActiveDisplayList(displayCount, activeDisplays.data(), &displayCount); 324 324 if (err) { 325 325 RELEASE_LOG(Media, "CGGetActiveDisplayList() returned error %d when trying to get the active display list", (int)err); -
trunk/Source/WebInspectorUI/ChangeLog
r258246 r258478 1 2020-03-15 Yusuke Suzuki <ysuzuki@apple.com> 2 3 Should not use variable-length-array (VLA) 4 https://bugs.webkit.org/show_bug.cgi?id=209043 5 6 Reviewed by Mark Lam. 7 8 * Configurations/Base.xcconfig: 9 1 10 2020-03-10 Devin Rousso <drousso@apple.com> 2 11 -
trunk/Source/WebInspectorUI/Configurations/Base.xcconfig
r256108 r258478 65 65 GCC_WARN_UNUSED_FUNCTION = YES; 66 66 GCC_WARN_UNUSED_VARIABLE = YES 67 WARNING_CFLAGS = -Wall -W -Wcast-qual -Wchar-subscripts -Wconditional-uninitialized -Wformat-security -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-unused-parameter -Wexit-time-destructors ;67 WARNING_CFLAGS = -Wall -W -Wcast-qual -Wchar-subscripts -Wconditional-uninitialized -Wformat-security -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-unused-parameter -Wexit-time-destructors -Wvla; 68 68 69 69 ENGINEERING_BUILD_DEFINES = $(ENGINEERING_BUILD_DEFINES_$(ENGINEERING_BUILD)); -
trunk/Source/WebKit/ChangeLog
r258477 r258478 1 2020-03-15 Yusuke Suzuki <ysuzuki@apple.com> 2 3 Should not use variable-length-array (VLA) 4 https://bugs.webkit.org/show_bug.cgi?id=209043 5 6 Reviewed by Mark Lam. 7 8 * Configurations/Base.xcconfig: 9 * UIProcess/_WKTouchEventGenerator.mm: 10 (-[_WKTouchEventGenerator touchDown:touchCount:]): 11 (-[_WKTouchEventGenerator liftUp:touchCount:]): 12 (-[_WKTouchEventGenerator moveToPoints:touchCount:duration:]): 13 1 14 2020-03-14 Brady Eidson <beidson@apple.com> 2 15 -
trunk/Source/WebKit/Configurations/Base.xcconfig
r257755 r258478 87 87 OTHER_MIGFLAGS = -F$(BUILT_PRODUCTS_DIR); 88 88 PREBINDING = NO; 89 WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wconditional-uninitialized -Wextra-tokens -Wformat-security -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wno-unused-parameter -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough ;89 WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wconditional-uninitialized -Wextra-tokens -Wformat-security -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wno-unused-parameter -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough -Wvla; 90 90 91 91 TARGET_MAC_OS_X_VERSION_MAJOR = $(TARGET_MAC_OS_X_VERSION_MAJOR$(MACOSX_DEPLOYMENT_TARGET:suffix:identifier)); -
trunk/Source/WebKit/UIProcess/_WKTouchEventGenerator.mm
r246513 r258478 295 295 touchCount = std::min(touchCount, HIDMaxTouchCount); 296 296 297 CGPoint locations[touchCount];297 Vector<CGPoint> locations(touchCount); 298 298 299 299 for (NSUInteger index = 0; index < touchCount; ++index) 300 300 locations[index] = location; 301 301 302 [self touchDownAtPoints:locations touchCount:touchCount];302 [self touchDownAtPoints:locations.data() touchCount:touchCount]; 303 303 } 304 304 … … 328 328 touchCount = std::min(touchCount, HIDMaxTouchCount); 329 329 330 CGPoint locations[touchCount];330 Vector<CGPoint> locations(touchCount); 331 331 332 332 for (NSUInteger index = 0; index < touchCount; ++index) 333 333 locations[index] = location; 334 334 335 [self liftUpAtPoints:locations touchCount:touchCount];335 [self liftUpAtPoints:locations.data() touchCount:touchCount]; 336 336 } 337 337 … … 345 345 touchCount = std::min(touchCount, HIDMaxTouchCount); 346 346 347 CGPoint startLocations[touchCount];348 CGPoint nextLocations[touchCount];347 Vector<CGPoint> startLocations(touchCount); 348 Vector<CGPoint> nextLocations(touchCount); 349 349 350 350 CFAbsoluteTime startTime = CFAbsoluteTimeGetCurrent(); … … 362 362 nextLocations[i] = calculateNextCurveLocation(startLocations[i], newLocations[i], interval); 363 363 } 364 [self _updateTouchPoints:nextLocations count:touchCount];364 [self _updateTouchPoints:nextLocations.data() count:touchCount]; 365 365 366 366 delayBetweenMove(eventIndex++, elapsed); -
trunk/Source/WebKitLegacy/mac/ChangeLog
r258379 r258478 1 2020-03-15 Yusuke Suzuki <ysuzuki@apple.com> 2 3 Should not use variable-length-array (VLA) 4 https://bugs.webkit.org/show_bug.cgi?id=209043 5 6 Reviewed by Mark Lam. 7 8 * Configurations/Base.xcconfig: 9 1 10 2020-03-12 Brent Fulgham <bfulgham@apple.com> 2 11 -
trunk/Source/WebKitLegacy/mac/Configurations/Base.xcconfig
r257755 r258478 89 89 CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 90 90 PREBINDING = NO; 91 WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wconditional-uninitialized -Wextra-tokens -Wformat-security -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wno-unused-parameter -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough ;91 WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wconditional-uninitialized -Wextra-tokens -Wformat-security -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wno-unused-parameter -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough -Wvla; 92 92 93 93 TARGET_MAC_OS_X_VERSION_MAJOR = $(TARGET_MAC_OS_X_VERSION_MAJOR$(MACOSX_DEPLOYMENT_TARGET:suffix:identifier)); -
trunk/Source/bmalloc/ChangeLog
r258460 r258478 1 2020-03-15 Yusuke Suzuki <ysuzuki@apple.com> 2 3 Should not use variable-length-array (VLA) 4 https://bugs.webkit.org/show_bug.cgi?id=209043 5 6 Reviewed by Mark Lam. 7 8 * Configurations/Base.xcconfig: 9 1 10 2020-03-13 Saam Barati <sbarati@apple.com> 2 11 -
trunk/Source/bmalloc/Configurations/Base.xcconfig
r257755 r258478 95 95 GCC_WARN_UNUSED_VARIABLE = YES; 96 96 PREBINDING = NO; 97 WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wconditional-uninitialized -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough ;97 WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wconditional-uninitialized -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough -Wvla; 98 98 99 99 TARGET_MAC_OS_X_VERSION_MAJOR = $(TARGET_MAC_OS_X_VERSION_MAJOR$(MACOSX_DEPLOYMENT_TARGET:suffix:identifier)); -
trunk/Tools/ChangeLog
r258458 r258478 1 2020-03-15 Yusuke Suzuki <ysuzuki@apple.com> 2 3 Should not use variable-length-array (VLA) 4 https://bugs.webkit.org/show_bug.cgi?id=209043 5 6 Reviewed by Mark Lam. 7 8 * ContentExtensionTester/Configurations/Base.xcconfig: 9 * lldb/lldbWebKitTester/Configurations/Base.xcconfig: 10 1 11 2020-03-13 Alex Christensen <achristensen@webkit.org> 2 12 -
trunk/Tools/ContentExtensionTester/Configurations/Base.xcconfig
r257755 r258478 66 66 GCC_WARN_UNUSED_FUNCTION = YES; 67 67 GCC_WARN_UNUSED_VARIABLE = YES; 68 WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough ;68 WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough -Wvla; 69 69 70 70 TARGET_MAC_OS_X_VERSION_MAJOR = $(TARGET_MAC_OS_X_VERSION_MAJOR$(MACOSX_DEPLOYMENT_TARGET:suffix:identifier)); -
trunk/Tools/lldb/lldbWebKitTester/Configurations/Base.xcconfig
r257755 r258478 83 83 GCC_WARN_UNUSED_FUNCTION = YES; 84 84 GCC_WARN_UNUSED_VARIABLE = NO; 85 WARNING_CFLAGS = -Wcast-qual -Wchar-subscripts -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough ;85 WARNING_CFLAGS = -Wcast-qual -Wchar-subscripts -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough -Wvla; 86 86 87 87 HEADER_SEARCH_PATHS = ${BUILT_PRODUCTS_DIR}/usr/local/include;
Note: See TracChangeset
for help on using the changeset viewer.