Build fix for newer versions of MSVC.

Rubber stamped by Mark Lam.

Some versions of MSVC optimize the inline optimization of
index away, triggering an uninitialized variable error. This
change avoids this problem.

* runtime/Options.cpp:
(JSC::optionTypeSpecificIndex):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@251257 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index b1cd180..b5a10a7 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,16 @@
+2019-10-17  Brent Fulgham  <bfulgham@apple.com>
+
+        Build fix for newer versions of MSVC.
+
+        Rubber stamped by Mark Lam.
+
+        Some versions of MSVC optimize the inline optimization of
+        index away, triggering an uninitialized variable error. This
+        change avoids this problem.
+
+        * runtime/Options.cpp:
+        (JSC::optionTypeSpecificIndex):
+
 2019-10-17  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: rework frontend agent construction to allow commands/events to be controlled by the related target's type
diff --git a/Source/JavaScriptCore/runtime/Options.cpp b/Source/JavaScriptCore/runtime/Options.cpp
index 850ee71..29bf1dd 100644
--- a/Source/JavaScriptCore/runtime/Options.cpp
+++ b/Source/JavaScriptCore/runtime/Options.cpp
@@ -291,7 +291,9 @@
 template<OptionTypeID type, OptionID id>
 constexpr size_t optionTypeSpecificIndex()
 {
-    size_t index = 0;
+    size_t index;
+    index = 0; // MSVC (16.3.5) improperly optimizes away the inline initialization of index, so use an explicit assignment.
+
 #define COUNT_INDEX_AND_FIND_MATCH(type_, name_, defaultValue_, availability_, description_) \
     if (id == OptionID::name_) \
         return index; \