Przeglądaj źródła

Add lower bounds check on enum to AsmJsJITInfo::GetTypedSlotInfo

Michael Ferris 9 lat temu
rodzic
commit
2a33bbb01e
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      lib/Backend/AsmJsJITInfo.cpp

+ 1 - 1
lib/Backend/AsmJsJITInfo.cpp

@@ -16,7 +16,7 @@ WAsmJs::TypedSlotInfo
 AsmJsJITInfo::GetTypedSlotInfo(WAsmJs::Types type) const
 {
     WAsmJs::TypedSlotInfo info;
-    if (type < WAsmJs::LIMIT)
+    if (type >= 0 && type < WAsmJs::LIMIT)
     {
         info.byteOffset = m_data.typedSlotInfos[type].byteOffset;
         info.constCount = m_data.typedSlotInfos[type].constCount;