Avoid undefined operation

Andreas Schwab schwab@suse.de
Wed Jun 26 13:09:00 GMT 2002


This fixes an undefined operation on PC.  Regtested on i486-suse-linux.
Committed as obvious on head and 3.1 branch.

2002-06-25  Andreas Schwab  <schwab@suse.de>

	* expr.c (JSR): Avoid undefined operation on PC.

--- gcc/java/expr.c.~1.132.2.9.~	2002-04-25 12:05:34.000000000 +0200
+++ gcc/java/expr.c	2002-06-25 11:24:15.000000000 +0200
@@ -2981,7 +2981,11 @@ process_jvm_instruction (PC, byte_ops, l
   }
 
 #define JSR(OPERAND_TYPE, OPERAND_VALUE) \
-  build_java_jsr (oldpc+OPERAND_VALUE, PC);
+  {						    \
+    /* OPERAND_VALUE may have side-effects on PC */ \
+    int opvalue = OPERAND_VALUE;		    \
+    build_java_jsr (oldpc + opvalue, PC);	    \
+  }
 
 /* Push a constant onto the stack. */
 #define PUSHC(OPERAND_TYPE, OPERAND_VALUE) \

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



More information about the Java-patches mailing list