* Removed all Id tags.
[cacao.git] / src / vm / jit / powerpc / patcher.c
index 105f7a583afdc3f04c3f126cdeb3136cebd648f1..d941b7d632e95e76426f7c100b245c56d534c7f3 100644 (file)
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: patcher.c 8216 2007-07-19 13:51:21Z michi $
-
 */
 
 
 #include "config.h"
 
 #include <assert.h>
+#include <stdint.h>
 
 #include "vm/types.h"
 
@@ -337,7 +336,7 @@ bool patcher_get_putstatic(patchref_t *pr)
 
        /* patch the field value's address */
 
-       *((ptrint *) datap) = (ptrint) &(fi->value);
+       *((intptr_t *) datap) = (intptr_t) fi->value;
 
        /* synchronize data cache */
 
@@ -389,11 +388,13 @@ bool patcher_get_putfield(patchref_t *pr)
                disp = *((u4 *) (ra + 0 * 4));
 
                if (disp == 4) {
+                       *((u4 *) (ra + 0 * 4)) &= 0xffff0000;
                        *((u4 *) (ra + 0 * 4)) |= (s2) ((fi->offset + 4) & 0x0000ffff);
                        *((u4 *) (ra + 1 * 4)) |= (s2) ((fi->offset + 0) & 0x0000ffff);
                }
                else {
                        *((u4 *) (ra + 0 * 4)) |= (s2) ((fi->offset + 0) & 0x0000ffff);
+                       *((u4 *) (ra + 1 * 4)) &= 0xffff0000;
                        *((u4 *) (ra + 1 * 4)) |= (s2) ((fi->offset + 4) & 0x0000ffff);
                }
        }