# HG changeset patch # User Bram Moolenaar # Date 1684499405 -7200 # Node ID d863a33cb220367519c03c5a1ac7fedf22a479df # Parent 63305439430b00f5ea71416e36ce319b469a9d50 patch 9.0.1567: profiler calculation may be wrong on 32 bit builds Commit: https://github.com/vim/vim/commit/d13c254d100509271b37d609c19e45c857352181 Author: Isao Sato Date: Fri May 19 13:20:34 2023 +0100 patch 9.0.1567: profiler calculation may be wrong on 32 bit builds Problem: Profiler calculation may be wrong on 32 bit builds. Solution: Use 64 bit variable if possible. (Isao Sato, closes https://github.com/vim/vim/issues/12412) diff --git a/src/profiler.c b/src/profiler.c --- a/src/profiler.c +++ b/src/profiler.c @@ -123,10 +123,11 @@ profile_setlimit(long msec, proftime_T * QueryPerformanceFrequency(&fr); tm->QuadPart += (LONGLONG)((double)msec / 1000.0 * (double)fr.QuadPart); # else - long fsec; + varnumber_T fsec; // this should be 64 bit if possible PROF_GET_TIME(tm); - fsec = (long)tm->tv_fsec + (long)msec * (TV_FSEC_SEC / 1000); + fsec = (varnumber_T)tm->tv_fsec + + (varnumber_T)msec * (varnumber_T)(TV_FSEC_SEC / 1000); tm->tv_fsec = fsec % (long)TV_FSEC_SEC; tm->tv_sec += fsec / (long)TV_FSEC_SEC; # endif diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -696,6 +696,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1567, +/**/ 1566, /**/ 1565,