Fixes PR85 for powerpc64.
[cacao.git] / src / vm / jit / powerpc64 / patcher.c
index 85f68441e528e7a92c43aacb3dee2b73fb89f186..117e2332d4a74bcfc598e125e8959d4e720f3f4e 100644 (file)
@@ -2,6 +2,7 @@
 
    Copyright (C) 1996-2005, 2006, 2007, 2008
    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
+   Copyright (C) 2008 Theobroma Systems Ltd.
 
    This file is part of CACAO.
 
@@ -65,6 +66,22 @@ void patcher_patch_code(patchref_t *pr)
 }
 
 
+/**
+ * Check if the trap instruction at the given PC is valid.
+ *
+ * @param pc Program counter.
+ *
+ * @return true if valid, false otherwise.
+ */
+bool patcher_is_valid_trap_instruction_at(void* pc)
+{
+       uint32_t mcode = *((uint32_t*) pc);
+
+       // Check for the undefined instruction we use.
+       return (mcode == 0x00000000);
+}
+
+
 /* patcher_get_putstatic *******************************************************
 
    Machine code: