* src/vm/jit/powerpc/md.c (md_get_method_patch_address): Fixed
authortwisti <none@none>
Fri, 25 May 2007 15:05:04 +0000 (15:05 +0000)
committertwisti <none@none>
Fri, 25 May 2007 15:05:04 +0000 (15:05 +0000)
warning, use vm_abort.

src/vm/jit/powerpc/md.c

index 227a37090b843796258f84103354997354bd1c43..3e0ec2e7fee3efe60406bc3167cd52165bf2e04b 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: md.c 7596 2007-03-28 21:05:53Z twisti $
+   $Id: md.c 7968 2007-05-25 15:05:04Z twisti $
 
 */
 
@@ -125,6 +125,7 @@ u1 *md_get_method_patch_address(u1 *ra, stackframeinfo *sfi, u1 *mptr)
 
        if ((mcode >> 16) == 0x3c19) {
                /* XXX write a regression for this */
+               pa = NULL;
                assert(0);
 
                /* get displacement of first instruction (addis) */
@@ -138,8 +139,8 @@ u1 *md_get_method_patch_address(u1 *ra, stackframeinfo *sfi, u1 *mptr)
                assert((mcode >> 16) != 0x6739);
 
                offset += (s2) (mcode & 0x0000ffff);
-
-       else {
+       }
+       else {
                /* get the offset from the instruction */
 
                offset = (s2) (mcode & 0x0000ffff);
@@ -150,8 +151,8 @@ u1 *md_get_method_patch_address(u1 *ra, stackframeinfo *sfi, u1 *mptr)
                        /* get the final data segment address */
 
                        pa = sfi->pv + offset;
-
-               else if ((mcode >> 16) == 0x81ac) {
+               }
+               else if ((mcode >> 16) == 0x81ac) {
                        /* in this case we use the passed method pointer */
 
                        /* return NULL if no mptr was specified (used for replacement) */
@@ -160,11 +161,16 @@ u1 *md_get_method_patch_address(u1 *ra, stackframeinfo *sfi, u1 *mptr)
                                return NULL;
 
                        pa = mptr + offset;
-
-               else {
+               }
+               else {
                        /* catch any problems */
 
-                       assert(0);
+                       vm_abort("md_get_method_patch_address: unknown instruction %x",
+                                        mcode);
+
+                       /* keep compiler happy */
+
+                       pa = NULL;
                }
        }