From d2053d51d206feb7b8f13fa99730cd2327de41cb Mon Sep 17 00:00:00 2001 From: Eric Scharff Date: Tue, 2 Oct 2007 09:50:08 -0600 Subject: [PATCH] Floats are always passed as doubles in varargs calls. Properly pop them off the stack and cast them --- src/interpret.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/interpret.cpp b/src/interpret.cpp index 778d56b3ea..2ada7d129e 100644 --- a/src/interpret.cpp +++ b/src/interpret.cpp @@ -2663,6 +2663,14 @@ pushArguments(Thread* t, object this_, const char* spec, bool indirectObjects, ++ s; pushLong(t, va_arg(a, uint64_t)); break; + + case 'F': { + ++ s; + float f = va_arg(a, double); + uint32_t i; + memcpy(&i, &f, 4); + pushInt(t, i); + } break; default: ++ s;