[kaffe] CVS kaffe (robilad): Cross-compilation fix for verifier
Kaffe CVS
cvs-commits at kaffe.org
Sun Mar 13 09:25:43 PST 2005
PatchSet 5549
Date: 2005/03/13 17:19:59
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
(TWIDE): Made static.
(getTWIDE) Added.
* kaffe/kaffevm/verifier/verify-type.h:
(TWIDE) Removed prototype.
(getTWIDE) Added prototype.
* kaffe/kaffevm/verifier/verify.c,
kaffe/kaffevm/verifier/verify-block.c:
Replaced use of TWIDE by getTWIDE.
Members:
ChangeLog:1.3723->1.3724
kaffe/kaffevm/verifier/verify-block.c:1.22->1.23
kaffe/kaffevm/verifier/verify-type.c:1.25->1.26
kaffe/kaffevm/verifier/verify-type.h:1.22->1.23
kaffe/kaffevm/verifier/verify.c:1.13->1.14
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3723 kaffe/ChangeLog:1.3724
--- kaffe/ChangeLog:1.3723 Sun Mar 13 17:14:34 2005
+++ kaffe/ChangeLog Sun Mar 13 17:19:59 2005
@@ -1,6 +1,20 @@
2005-03-13 Dalibor Topic <robilad at kaffe.org>
* kaffe/kaffevm/verifier/verify-type.c
+ (TWIDE): Made static.
+ (getTWIDE) Added.
+
+ * kaffe/kaffevm/verifier/verify-type.h:
+ (TWIDE) Removed prototype.
+ (getTWIDE) Added prototype.
+
+ * kaffe/kaffevm/verifier/verify.c,
+ kaffe/kaffevm/verifier/verify-block.c:
+ Replaced use of TWIDE by getTWIDE.
+
+2005-03-13 Dalibor Topic <robilad at kaffe.org>
+
+ * kaffe/kaffevm/verifier/verify-type.c
(TINT): Made static.
(getTINT) Added.
Index: kaffe/kaffe/kaffevm/verifier/verify-block.c
diff -u kaffe/kaffe/kaffevm/verifier/verify-block.c:1.22 kaffe/kaffe/kaffevm/verifier/verify-block.c:1.23
--- kaffe/kaffe/kaffevm/verifier/verify-block.c:1.22 Sun Mar 13 17:14:36 2005
+++ kaffe/kaffe/kaffevm/verifier/verify-block.c Sun Mar 13 17:20:03 2005
@@ -257,7 +257,7 @@
const Type* type)
{
opstackPushBlind(block, type);
- opstackPushBlind(block, TWIDE);
+ opstackPushBlind(block, getTWIDE());
}
/*
@@ -379,7 +379,7 @@
if (block->locals[_N].data.class != (_TINFO)->data.class) { \
return verifyError(v, "local variable not of correct type"); \
} \
- else if (block->locals[_N + 1].data.class != TWIDE->data.class) { \
+ else if (block->locals[_N + 1].data.class != getTWIDE()->data.class) { \
return verifyError(v, "accessing a long or double in a local where the following local has been corrupted"); \
}
@@ -418,7 +418,7 @@
* this only works with doubles and longs
*/
#define OPSTACK_WPEEK_T_BLIND(_TINFO) \
- if (getOpstackTop(block)->data.class != TWIDE->data.class) { \
+ if (getOpstackTop(block)->data.class != getTWIDE()->data.class) { \
return verifyError(v, "trying to pop a wide value off operand stack where there is none"); \
} else if (getOpstackWTop(block)->data.class != (_TINFO)->data.class) { \
return verifyError(v, "mismatched stack types"); \
@@ -676,7 +676,7 @@
LSTORE_common:
OPSTACK_WPOP_T(getTLONG());
block->locals[idx] = *getTLONG();
- block->locals[idx + 1] = *TWIDE;
+ block->locals[idx + 1] = *getTWIDE();
break;
@@ -703,7 +703,7 @@
DSTORE_common:
OPSTACK_WPOP_T(getTDOUBLE());
block->locals[idx] = *getTDOUBLE();
- block->locals[idx + 1] = *TWIDE;
+ block->locals[idx + 1] = *getTWIDE();
break;
@@ -1269,7 +1269,7 @@
case PUTSTATIC:
- if (getOpstackTop(block) == TWIDE) n = 2;
+ if (getOpstackTop(block) == getTWIDE()) n = 2;
else n = 1;
ENSURE_OPSTACK_SIZE(n);
Index: kaffe/kaffe/kaffevm/verifier/verify-type.c
diff -u kaffe/kaffe/kaffevm/verifier/verify-type.c:1.25 kaffe/kaffe/kaffevm/verifier/verify-type.c:1.26
--- kaffe/kaffe/kaffevm/verifier/verify-type.c:1.25 Sun Mar 13 17:14:37 2005
+++ kaffe/kaffe/kaffevm/verifier/verify-type.c Sun Mar 13 17:20:03 2005
@@ -70,7 +70,12 @@
* in local variables or on the operand stack
*/
static Type _WIDE;
-Type* TWIDE = &_WIDE;
+static Type* TWIDE = &_WIDE;
+
+Type* getTWIDE(void)
+{
+ return TWIDE;
+}
bool
isWide(const Type * t)
Index: kaffe/kaffe/kaffevm/verifier/verify-type.h
diff -u kaffe/kaffe/kaffevm/verifier/verify-type.h:1.22 kaffe/kaffe/kaffevm/verifier/verify-type.h:1.23
--- kaffe/kaffe/kaffevm/verifier/verify-type.h:1.22 Sun Mar 13 17:14:37 2005
+++ kaffe/kaffe/kaffevm/verifier/verify-type.h Sun Mar 13 17:20:03 2005
@@ -100,7 +100,7 @@
extern Type* getTLONG(void);
extern Type* getTDOUBLE(void);
extern Type* getTNULL(void);
-extern Type* TWIDE;
+extern Type* getTWIDE(void);
extern Type* getTOBJ(void);
Index: kaffe/kaffe/kaffevm/verifier/verify.c
diff -u kaffe/kaffe/kaffevm/verifier/verify.c:1.13 kaffe/kaffe/kaffevm/verifier/verify.c:1.14
--- kaffe/kaffe/kaffevm/verifier/verify.c:1.13 Sun Mar 13 17:14:37 2005
+++ kaffe/kaffe/kaffevm/verifier/verify.c Sun Mar 13 17:20:03 2005
@@ -754,13 +754,13 @@
case 'J':
binfo->opstack[binfo->stacksz] = *getTLONG();
- binfo->opstack[binfo->stacksz + 1] = *TWIDE;
+ binfo->opstack[binfo->stacksz + 1] = *getTWIDE();
binfo->stacksz += 2;
break;
case 'D':
binfo->opstack[binfo->stacksz] = *getTDOUBLE();
- binfo->opstack[binfo->stacksz + 1] = *TWIDE;
+ binfo->opstack[binfo->stacksz + 1] = *getTWIDE();
binfo->stacksz += 2;
break;
@@ -860,7 +860,7 @@
return localOverflowErrorInLoadInitialArgs(v, argbuf);
}
locals[paramCount] = *getTLONG();
- locals[paramCount+1] = *TWIDE;
+ locals[paramCount+1] = *getTWIDE();
paramCount += 2;
break;
@@ -869,7 +869,7 @@
return localOverflowErrorInLoadInitialArgs(v, argbuf);
}
locals[paramCount] = *getTDOUBLE();
- locals[paramCount+1] = *TWIDE;
+ locals[paramCount+1] = *getTWIDE();
paramCount += 2;
break;
More information about the kaffe
mailing list