Преглед изворни кода

[MERGE #466] Fix nested function array allocation

Merge pull request #466 from leirocks:nestedFuncFix
Lei Shi пре 10 година
родитељ
комит
61fdc0d854
2 измењених фајлова са 2 додато и 2 уклоњено
  1. 1 1
      lib/Runtime/Base/FunctionBody.cpp
  2. 1 1
      lib/Runtime/Base/FunctionBody.h

+ 1 - 1
lib/Runtime/Base/FunctionBody.cpp

@@ -1143,7 +1143,7 @@ namespace Js
         if (nestedCount > 0)
         {
             nestedArray = RecyclerNewPlusZ(m_scriptContext->GetRecycler(),
-                nestedCount*sizeof(FunctionProxy), NestedArray, nestedCount);
+                nestedCount*sizeof(FunctionProxy*), NestedArray, nestedCount);
         }
         else
         {

+ 1 - 1
lib/Runtime/Base/FunctionBody.h

@@ -1370,7 +1370,7 @@ namespace Js
         {
             NestedArray(uint32 count) :nestedCount(count) {}
             uint32 nestedCount;
-            FunctionProxy* functionProxyArray[1];
+            FunctionProxy* functionProxyArray[0];
         };
         template<typename Fn>
         void ForEachNestedFunc(Fn fn)