diff --git a/include/sol/stack_check_unqualified.hpp b/include/sol/stack_check_unqualified.hpp index 8d72a11c..3a39709a 100644 --- a/include/sol/stack_check_unqualified.hpp +++ b/include/sol/stack_check_unqualified.hpp @@ -140,12 +140,12 @@ namespace stack { return false; } #endif // Do not allow strings to be numbers - int isnum = 0; #if (defined(SOL_SAFE_NUMERICS) && SOL_SAFE_NUMERICS) && !(defined(SOL_NO_CHECK_NUMBER_PRECISION) && SOL_NO_CHECK_NUMBER_PRECISION) + int isnum = 0; const lua_Number v = lua_tonumberx(L, index, &isnum); const bool success = isnum != 0 && static_cast(llround(v)) == v; #else - const bool success = isnum != 0; + const bool success = true; #endif // Safe numerics and number precision checking if (!success) { // expected type, actual type