Fix implicit conversion error (#4684)

This patch fixes the #4682

JerryScript-DCO-1.0-Signed-off-by: Daniel Batiz batizjob@gmail.com
This commit is contained in:
batizdaniel 2021-06-24 15:38:56 +02:00 committed by GitHub
parent d97d407eee
commit 6de17b204e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,12 +156,12 @@ ecma_date_year_from_time (ecma_number_t time) /**< time value */
int32_t approx = (int32_t) (floor (time / ECMA_DATE_MS_PER_DAY / 365.2425) + 1970);
int64_t year_ms = ecma_date_day_from_year (approx) * ((int64_t) ECMA_DATE_MS_PER_DAY);
if (year_ms > time)
if ((ecma_number_t) year_ms > time)
{
approx--;
}
if (year_ms + ecma_date_days_in_year (approx) * ((int64_t) ECMA_DATE_MS_PER_DAY) <= time)
if ((ecma_number_t) (year_ms + ecma_date_days_in_year (approx) * ((int64_t) ECMA_DATE_MS_PER_DAY)) <= time)
{
approx++;
}