Tweaked bounds check

This commit is contained in:
2022-11-12 11:39:32 +00:00
parent fa20763c07
commit 7bf18a744c

View File

@@ -129,7 +129,7 @@ static int nativeCreateTimer(Interpreter* interpreter, LiteralArray* arguments)
return -1;
}
if (AS_INTEGER(microsecondLiteral) <= -1000 * 1000 || AS_INTEGER(microsecondLiteral) >= 1000 * 1000) {
if (AS_INTEGER(microsecondLiteral) <= -1000 * 1000 || AS_INTEGER(microsecondLiteral) >= 1000 * 1000 || (AS_INTEGER(secondLiteral) != 0 && AS_INTEGER(microsecondLiteral) < 0) ) {
interpreter->errorOutput("Microseconds out of range in createTimer\n");
freeLiteral(secondLiteral);
freeLiteral(microsecondLiteral);