From 234d56a8c4da8b3bad47f6f75aa53d1067b1aad9 Mon Sep 17 00:00:00 2001 From: Sampo Savolainen Date: Mon, 22 Sep 2008 20:44:46 +0000 Subject: Fixed overflow issue. Code originally meant to truncate the 64 bit integer did not work as assembler doesn't "cast" variables like C does. get_cycles() was passing the memory address of a 32 bit unsigned int to the x86 call which required 64 bits of storage space. The extra 32 bits corrupted whatever was on the stack next to the variable. git-svn-id: svn://localhost/ardour2/branches/3.0@3793 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/cycles.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libs') diff --git a/libs/ardour/ardour/cycles.h b/libs/ardour/ardour/cycles.h index 0d1ac154dd..2199a2eb9c 100644 --- a/libs/ardour/ardour/cycles.h +++ b/libs/ardour/ardour/cycles.h @@ -48,10 +48,10 @@ extern cycles_t cacheflush_time; static inline cycles_t get_cycles (void) { - uint32_t long ret; + cycles_t ret; rdtscll(ret); - return ret; + return ret & 0xffffffff; } #elif defined(__powerpc__) -- cgit v1.2.3