1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-02-20 19:57:12 +01:00

Fix infinite loop when registering constants.

This commit is contained in:
Sandu Liviu Catalin 2016-06-16 03:12:01 +03:00
parent f8fabaf0b5
commit af9c00298c

View File

@ -1057,7 +1057,7 @@ static Enumeration RegisterEnum(HSQUIRRELVM vm, CSStr name, const EnumElement *
// Allocate an empty enumeration
Enumeration e(vm);
// Register the values from the received data
for (Uint32 n = 0; n < count; ++n, ++count)
for (Uint32 n = 0; n < count; ++n, ++data)
{
e.Const(data->Name, data->Value);
}
@ -1111,7 +1111,6 @@ void Register_Constants(HSQUIRRELVM vm)
.Const(_SC("Infinity"), static_cast< float >(INFINITY))
.Const(_SC("Inf"), static_cast< float >(INFINITY))
.Const(_SC("Nan"), static_cast< float >(NAN))
);
RegisterEnum(vm, _SC("SqArchitectre"), g_ArchitectureEnum, SQENUMCOUNT(g_ArchitectureEnum));