gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSObject asm fix


From: David Chisnall
Subject: NSObject asm fix
Date: Mon, 30 Mar 2009 15:13:08 +0100

The code setting the floating point exception mask in NSObject is incorrect. It works coincidentally with GCC because GCC (at least, in current versions) adds an extra load and so the argument becomes %eax. If it is an indirect address then this code will not work due to the extra brackets (it will complain about unexpected characters in the assembler). Attached is a fix.

David

Index: NSObject.m
===================================================================
--- NSObject.m  (revision 27773)
+++ NSObject.m  (working copy)
@@ -1138,9 +1138,9 @@
       {
        volatile short cw;

-       __asm__ volatile ("fstcw (%0)" : : "g" (&cw));
+       __asm__ volatile ("fstcw %0" : : "g" (&cw));
        cw |= 1; /* Mask 'invalid' exception */
-       __asm__ volatile ("fldcw (%0)" : : "g" (&cw));
+       __asm__ volatile ("fldcw %0" : : "g" (&cw));
       }
 #endif






reply via email to

[Prev in Thread] Current Thread [Next in Thread]