[kaffe] CVS kaffe (robilad): Cross-compilation fix for verifier

Kaffe CVS cvs-commits at kaffe.org
Sun Mar 13 09:12:47 PST 2005


PatchSet 5547 
Date: 2005/03/13 17:07:53
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Cross-compilation fix for verifier

2005-03-13  Dalibor Topic  <robilad at kaffe.org>

* kaffe/kaffevm/verifier/verify-type.c
(TLONG): Made static.
(getTLONG) Added.

* kaffe/kaffevm/verifier/verify-type.h:
(TLONG) Removed prototype.
(getTLONG) Added prototype.

* kaffe/kaffevm/verifier/verify.c,
kaffe/kaffevm/verifier/verify-debug.c,
kaffe/kaffevm/verifier/verify-block.c:
Replaced use of TLONG by getTLONG.

Members: 
	ChangeLog:1.3721->1.3722 
	kaffe/kaffevm/verifier/verify-block.c:1.20->1.21 
	kaffe/kaffevm/verifier/verify-debug.c:1.13->1.14 
	kaffe/kaffevm/verifier/verify-type.c:1.23->1.24 
	kaffe/kaffevm/verifier/verify-type.h:1.20->1.21 
	kaffe/kaffevm/verifier/verify.c:1.11->1.12 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3721 kaffe/ChangeLog:1.3722
--- kaffe/ChangeLog:1.3721	Sun Mar 13 17:02:50 2005
+++ kaffe/ChangeLog	Sun Mar 13 17:07:53 2005
@@ -1,6 +1,21 @@
 2005-03-13  Dalibor Topic  <robilad at kaffe.org>
 
 	* kaffe/kaffevm/verifier/verify-type.c
+	(TLONG): Made static. 
+	(getTLONG) Added.
+
+	* kaffe/kaffevm/verifier/verify-type.h: 
+	(TLONG) Removed prototype.
+	(getTLONG) Added prototype.
+
+	* kaffe/kaffevm/verifier/verify.c,
+	kaffe/kaffevm/verifier/verify-debug.c,
+	kaffe/kaffevm/verifier/verify-block.c:
+	Replaced use of TLONG by getTLONG.
+	
+2005-03-13  Dalibor Topic  <robilad at kaffe.org>
+
+	* kaffe/kaffevm/verifier/verify-type.c
 	(TFLOAT): Made static. 
 	(getTFLOAT) Added.
 
Index: kaffe/kaffe/kaffevm/verifier/verify-block.c
diff -u kaffe/kaffe/kaffevm/verifier/verify-block.c:1.20 kaffe/kaffe/kaffevm/verifier/verify-block.c:1.21
--- kaffe/kaffe/kaffevm/verifier/verify-block.c:1.20	Sun Mar 13 17:02:57 2005
+++ kaffe/kaffe/kaffevm/verifier/verify-block.c	Sun Mar 13 17:07:55 2005
@@ -508,7 +508,7 @@
 			
 		case LCONST_0:
 		case LCONST_1:
-			OPSTACK_WPUSH(TLONG);
+			OPSTACK_WPUSH(getTLONG());
 			break;
 			
 		case DCONST_0:
@@ -541,7 +541,7 @@
 			GET_WIDX;
 			tag = CONST_TAG(idx, pool);
 			if (tag == CONSTANT_Long) {
-				OPSTACK_WPUSH(TLONG);
+				OPSTACK_WPUSH(getTLONG());
 			} else {
 				OPSTACK_WPUSH(getTDOUBLE());
 			}
@@ -661,8 +661,8 @@
 		case LLOAD:
 			GET_CONST_INDEX;
 		LLOAD_common:
-			ENSURE_LOCAL_WTYPE(idx, TLONG);
-			OPSTACK_WPUSH(TLONG);
+			ENSURE_LOCAL_WTYPE(idx, getTLONG());
+			OPSTACK_WPUSH(getTLONG());
 			break;
 			
 			
@@ -674,8 +674,8 @@
 		case LSTORE:
 			GET_CONST_INDEX;
 		LSTORE_common:
-			OPSTACK_WPOP_T(TLONG);
-			block->locals[idx] = *TLONG;
+			OPSTACK_WPOP_T(getTLONG());
+			block->locals[idx] = *getTLONG();
 			block->locals[idx + 1] = *TWIDE;
 			break;
 			
@@ -786,7 +786,7 @@
 		case CALOAD: ARRAY_LOAD(TINT,   getTCHARARR());  break;
 		case SALOAD: ARRAY_LOAD(TINT,   getTSHORTARR()); break;
 			
-		case LALOAD: ARRAY_WLOAD(TLONG,   getTLONGARR());   break;
+		case LALOAD: ARRAY_WLOAD(getTLONG(),   getTLONGARR());   break;
 		case DALOAD: ARRAY_WLOAD(getTDOUBLE(), getTDOUBLEARR()); break;
 #undef ARRAY_LOAD
 #undef ARRAY_WLOAD
@@ -871,7 +871,7 @@
 		case CASTORE: ARRAY_STORE(TINT,   getTCHARARR());  break;
 		case SASTORE: ARRAY_STORE(TINT,   getTSHORTARR()); break;
 			
-		case LASTORE: ARRAY_WSTORE(TLONG,   getTLONGARR());   break;
+		case LASTORE: ARRAY_WSTORE(getTLONG(),   getTLONGARR());   break;
 		case DASTORE: ARRAY_WSTORE(getTDOUBLE(), getTDOUBLEARR()); break;
 #undef ARRAY_STORE
 #undef ARRAY_WSTORE
@@ -908,15 +908,15 @@
 			
 		case LAND: case LOR:  case LXOR:
 		case LADD: case LSUB: case LMUL: case LDIV: case LREM:
-			OPSTACK_WPOP_T(TLONG);
+			OPSTACK_WPOP_T(getTLONG());
 			break;
 		case LNEG:
-			OPSTACK_WPEEK_T(TLONG);
+			OPSTACK_WPEEK_T(getTLONG());
 			break;
 			
 		case LSHL: case LSHR: case LUSHR:
 			OPSTACK_POP_T(TINT);
-			OPSTACK_WPEEK_T(TLONG);
+			OPSTACK_WPEEK_T(getTLONG());
 			break;
 			
 			
@@ -937,8 +937,8 @@
 			
 			
 		case LCMP:
-			OPSTACK_WPOP_T(TLONG);
-			OPSTACK_WPOP_T(TLONG);
+			OPSTACK_WPOP_T(getTLONG());
+			OPSTACK_WPOP_T(getTLONG());
 			opstackPushBlind(block, TINT);
 			break;
 			
@@ -987,7 +987,7 @@
 		case I2L:
 			OPSTACK_POP_T(TINT);
 			CHECK_STACK_OVERFLOW(2);
-			opstackWPushBlind(block, TLONG);
+			opstackWPushBlind(block, getTLONG());
 			break;
 		case I2D:
 			OPSTACK_POP_T(TINT);
@@ -1001,7 +1001,7 @@
 			break;
 		case F2L:
 			OPSTACK_POP_T(getTFLOAT());
-			OPSTACK_WPUSH(TLONG);
+			OPSTACK_WPUSH(getTLONG());
 			break;
 		case F2D:
 			OPSTACK_POP_T(getTFLOAT());
@@ -1009,15 +1009,15 @@
 			break;
 			
 		case L2I:
-			OPSTACK_WPOP_T(TLONG);
+			OPSTACK_WPOP_T(getTLONG());
 			opstackPushBlind(block, TINT);
 			break;
 		case L2F:
-			OPSTACK_WPOP_T(TLONG);
+			OPSTACK_WPOP_T(getTLONG());
 			opstackPushBlind(block, getTFLOAT());
 			break;
 		case L2D:
-			OPSTACK_WPOP_T(TLONG);
+			OPSTACK_WPOP_T(getTLONG());
 			opstackWPushBlind(block, getTDOUBLE());
 			break;
 			
@@ -1031,7 +1031,7 @@
 			break;
 		case D2L:
 			OPSTACK_WPOP_T(getTDOUBLE());
-			opstackWPushBlind(block, TLONG);
+			opstackWPushBlind(block, getTLONG());
 			break;
 			
 			
@@ -1198,7 +1198,7 @@
 				break;
 				
 			case 'F': opstackPushBlind(block, getTFLOAT()); break;
-			case 'J': OPSTACK_WPUSH(TLONG); break;
+			case 'J': OPSTACK_WPUSH(getTLONG()); break;
 			case 'D': OPSTACK_WPUSH(getTDOUBLE()); break;
 				
 			case '[':
@@ -1238,7 +1238,7 @@
 				break;
 				
 			case 'F': OPSTACK_POP_T_BLIND(getTFLOAT());   break;
-			case 'J': OPSTACK_WPOP_T_BLIND(TLONG);   break;
+			case 'J': OPSTACK_WPOP_T_BLIND(getTLONG());   break;
 			case 'D': OPSTACK_WPOP_T_BLIND(getTDOUBLE()); break;
 				
 			case '[':
@@ -1285,7 +1285,7 @@
 				break;
 				
 			case 'F': OPSTACK_POP_T_BLIND(getTFLOAT());   break;
-			case 'J': OPSTACK_WPOP_T_BLIND(TLONG);   break;
+			case 'J': OPSTACK_WPOP_T_BLIND(getTLONG());   break;
 			case 'D': OPSTACK_WPOP_T_BLIND(getTDOUBLE()); break;
 				
 			case '[':
@@ -1399,7 +1399,7 @@
 			}
 			break;
 		case LRETURN:
-			OPSTACK_WPEEK_T(TLONG);
+			OPSTACK_WPEEK_T(getTLONG());
 			sig = getMethodReturnSig(v->method);
 			if (strcmp(sig, "J")) {
 				return verifyError(v, "lreturn: method doesn't return a long");
Index: kaffe/kaffe/kaffevm/verifier/verify-debug.c
diff -u kaffe/kaffe/kaffevm/verifier/verify-debug.c:1.13 kaffe/kaffe/kaffevm/verifier/verify-debug.c:1.14
--- kaffe/kaffe/kaffevm/verifier/verify-debug.c:1.13	Sun Mar 13 17:02:57 2005
+++ kaffe/kaffe/kaffevm/verifier/verify-debug.c	Sun Mar 13 17:07:55 2005
@@ -426,7 +426,7 @@
 		if (type == TINT->data.class) {
 			dprintf("TINT");
 		}
-		else if (type == TLONG->data.class) {
+		else if (type == getTLONG()->data.class) {
 			dprintf("TLONG");
 		}
 		else if (type == getTFLOAT()->data.class) {
Index: kaffe/kaffe/kaffevm/verifier/verify-type.c
diff -u kaffe/kaffe/kaffevm/verifier/verify-type.c:1.23 kaffe/kaffe/kaffevm/verifier/verify-type.c:1.24
--- kaffe/kaffe/kaffevm/verifier/verify-type.c:1.23	Sun Mar 13 17:02:57 2005
+++ kaffe/kaffe/kaffevm/verifier/verify-type.c	Sun Mar 13 17:07:55 2005
@@ -46,8 +46,13 @@
 }
        
 static Type  verify_LONG;
-Type* TLONG = &verify_LONG;
-       
+static Type* TLONG = &verify_LONG;
+
+Type* getTLONG(void)
+{
+  return TLONG;
+}
+
 static Type  verify_DOUBLE;
 static Type* TDOUBLE = &verify_DOUBLE;
 
Index: kaffe/kaffe/kaffevm/verifier/verify-type.h
diff -u kaffe/kaffe/kaffevm/verifier/verify-type.h:1.20 kaffe/kaffe/kaffevm/verifier/verify-type.h:1.21
--- kaffe/kaffe/kaffevm/verifier/verify-type.h:1.20	Sun Mar 13 17:02:57 2005
+++ kaffe/kaffe/kaffevm/verifier/verify-type.h	Sun Mar 13 17:07:55 2005
@@ -97,7 +97,7 @@
 
 extern Type* TINT;
 extern Type* getTFLOAT(void);
-extern Type* TLONG;
+extern Type* getTLONG(void);
 extern Type* getTDOUBLE(void);
 extern Type* getTNULL(void);
 extern Type* TWIDE;
Index: kaffe/kaffe/kaffevm/verifier/verify.c
diff -u kaffe/kaffe/kaffevm/verifier/verify.c:1.11 kaffe/kaffe/kaffevm/verifier/verify.c:1.12
--- kaffe/kaffe/kaffevm/verifier/verify.c:1.11	Sun Mar 13 17:02:57 2005
+++ kaffe/kaffe/kaffevm/verifier/verify.c	Sun Mar 13 17:07:55 2005
@@ -690,7 +690,7 @@
 			break;
 			
 		case 'J':
-			if (binfo->opstack[paramIndex].data.class != TLONG->data.class ||
+			if (binfo->opstack[paramIndex].data.class != getTLONG()->data.class ||
 			    !isWide(&binfo->opstack[paramIndex + 1])) {
 				return typeErrorInCheckMethodCall(v, argbuf, pc, idx, pool, methSig);
 			}
@@ -753,7 +753,7 @@
 		break;
 		
 	case 'J':
-		binfo->opstack[binfo->stacksz]     = *TLONG;
+		binfo->opstack[binfo->stacksz]     = *getTLONG();
 		binfo->opstack[binfo->stacksz + 1] = *TWIDE;
 		binfo->stacksz += 2;
 		break;
@@ -859,7 +859,7 @@
 			if (paramCount + 1 > v->method->localsz) {
 				return localOverflowErrorInLoadInitialArgs(v, argbuf);
 			}
-			locals[paramCount] = *TLONG;
+			locals[paramCount] = *getTLONG();
 			locals[paramCount+1] = *TWIDE;
 			paramCount += 2;
 			break;




More information about the kaffe mailing list