[xdebug-dev] xdebug xdebug/xdebug_profiler.c - Fixed bug #69: Integer overflow in cachegrind summary.

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Fri, 9 Jul 2004 15:54:27 +0200

Date: Fri Jul 9 15:54:27 CEST 2004
User: Derick Rethans
Directory: xdebug

Log Message:
[0.25]
- Fixed bug #69: Integer overflow in cachegrind summary.

Modified files:
           xdebug/xdebug_profiler.c (version: 1.25)

[FILE: /xdebug/xdebug_profiler.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- xdebug/xdebug_profiler.c:1.24 Fri Apr 16 15:37:06 2004 GMT
+++ xdebug/xdebug_profiler.c Fri Jul 09 11:54:26 2004 GMT
@@ -136,9 +136,9 @@
 
         if (fse->function.function && strcmp(fse->function.function, "{main}") == 0) {
 #if MEMORY_LIMIT
- fprintf(XG(profile_file), "\nsummary: %ld %u\n\n", (long) (fse->profile.time * 10000000), AG(allocated_memory));
+ fprintf(XG(profile_file), "\nsummary: %lu %u\n\n", (unsigned long) (fse->profile.time * 10000000), AG(allocated_memory));
 #else
- fprintf(XG(profile_file), "\nsummary: %ld\n\n", (long) (fse->profile.time * 10000000));
+ fprintf(XG(profile_file), "\nsummary: %lu\n\n", (unsigned long) (fse->profile.time * 10000000));
 #endif
         }
 
@@ -152,9 +152,9 @@
 #endif
         }
 #if MEMORY_LIMIT
- fprintf(XG(profile_file), "%d %ld %ld\n", default_lineno, (long) (fse->profile.time * 10000000), (AG(allocated_memory) - fse->profile.memory) < 0 ? 0 : (AG(allocated_memory) - fse->profile.memory));
+ fprintf(XG(profile_file), "%d %lu %ld\n", default_lineno, (unsigned long) (fse->profile.time * 10000000), (AG(allocated_memory) - fse->profile.memory) < 0 ? 0 : (AG(allocated_memory) - fse->profile.memory));
 #else
- fprintf(XG(profile_file), "%d %ld\n", default_lineno, (long) (fse->profile.time * 10000000));
+ fprintf(XG(profile_file), "%d %lu\n", default_lineno, (unsigned long) (fse->profile.time * 10000000));
 #endif
 
         /* dump call list */
@@ -170,9 +170,9 @@
                 
                 fprintf(XG(profile_file), "calls=1 0 0\n");
 #if MEMORY_LIMIT
- fprintf(XG(profile_file), "%d %ld %ld\n", call_entry->lineno, (long) (call_entry->time_taken * 10000000), call_entry->mem_used < 0 ? 0 : call_entry->mem_used);
+ fprintf(XG(profile_file), "%d %lu %ld\n", call_entry->lineno, (unsigned long) (call_entry->time_taken * 10000000), call_entry->mem_used < 0 ? 0 : call_entry->mem_used);
 #else
- fprintf(XG(profile_file), "%d %ld\n", call_entry->lineno, (long) (call_entry->time_taken * 10000000));
+ fprintf(XG(profile_file), "%d %lu\n", call_entry->lineno, (unsigned long) (call_entry->time_taken * 10000000));
 #endif
         }
         fprintf(XG(profile_file), "\n");
Received on Fri Jul 09 2004 - 15:54:33 BST

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:02 BST