gallivm: (trivial) do division by 1000 with int64
authorRoland Scheidegger <sroland@vmware.com>
Mon, 23 Apr 2018 02:52:48 +0000 (04:52 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Tue, 24 Apr 2018 02:49:39 +0000 (04:49 +0200)
Conversion to int can otherwise overflow if compile times are over
~71min. (Yes this can happen...)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_init.c

index a9968649c06f0d5ff10b239bf89534265f45c0bc..800b2616c0d0bc8920b2b3bb27f88d386978c8d2 100644 (file)
@@ -604,7 +604,7 @@ gallivm_compile_module(struct gallivm_state *gallivm)
 
    if (gallivm_debug & GALLIVM_DEBUG_PERF) {
       int64_t time_end = os_time_get();
-      int time_msec = (int)(time_end - time_begin) / 1000;
+      int time_msec = (int)((time_end - time_begin) / 1000);
       assert(gallivm->module_name);
       debug_printf("optimizing module %s took %d msec\n",
                    gallivm->module_name, time_msec);