summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwrog <wrog>2006-12-06 23:54:53 (GMT)
committerwrog <wrog>2006-12-06 23:54:53 (GMT)
commit0d13527d1f076fb37e7fbaa556c8d07a03fa0036 (patch)
treeac052b0b62c77f30cccecc78eedefdcbc15e393a
parent58eb73b86fed01eaab4e9f8c2706a360054b9add (diff)
downloadmoo-cvs-0d13527d1f076fb37e7fbaa556c8d07a03fa0036.zip
moo-cvs-0d13527d1f076fb37e7fbaa556c8d07a03fa0036.tar.gz
moo-cvs-0d13527d1f076fb37e7fbaa556c8d07a03fa0036.tar.bz2
moo-cvs-0d13527d1f076fb37e7fbaa556c8d07a03fa0036.tar.xz
Fix compiler warnings about undefined behavior (bv assigned twice in JUMP(READ_BYTES(...))) and unused values
-rw-r--r--execute.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/execute.c b/execute.c
index e361663..e2207f0 100644
--- a/execute.c
+++ b/execute.c
@@ -732,7 +732,7 @@ run(char raise, enum error resumption_error, Var * result)
+ ((unsigned) bv[-2] << 8) \
+ bv[-1]))))
-#define SKIP_BYTES(bv, nb) (void)(bv += nb)
+#define SKIP_BYTES(bv, nb) ((void)(bv += nb))
#define LOAD_STATE_VARIABLES() \
do { \
@@ -810,8 +810,10 @@ do { \
Var cond;
cond = POP();
- if (!is_true(cond)) /* jump if false */
- JUMP(READ_BYTES(bv, bc.numbytes_label));
+ if (!is_true(cond)) { /* jump if false */
+ unsigned lab = READ_BYTES(bv, bc.numbytes_label);
+ JUMP(lab);
+ }
else {
SKIP_BYTES(bv, bc.numbytes_label);
}
@@ -820,7 +822,10 @@ do { \
break;
case OP_JUMP:
- JUMP(READ_BYTES(bv, bc.numbytes_label));
+ {
+ unsigned lab = READ_BYTES(bv, bc.numbytes_label);
+ JUMP(lab);
+ }
break;
case OP_FOR_LIST:
@@ -1825,6 +1830,7 @@ do { \
{
Var v, marker;
int i;
+ unsigned lab;
if (eop == EOP_END_CATCH)
v = POP();
@@ -1840,7 +1846,8 @@ do { \
if (eop == EOP_END_CATCH)
PUSH(v);
- JUMP(READ_BYTES(bv, bc.numbytes_label));
+ lab = READ_BYTES(bv, bc.numbytes_label);
+ JUMP(lab);
}
break;
@@ -1892,7 +1899,7 @@ do { \
goto do_test;
case EOP_EXIT_ID:
- READ_BYTES(bv, bc.numbytes_var_name); /* ignore id */
+ SKIP_BYTES(bv, bc.numbytes_var_name); /* ignore id */
/* fall thru */
case EOP_EXIT:
{
@@ -2875,6 +2882,9 @@ char rcsid_execute[] = "$Id$";
/*
* $Log$
+ * Revision 1.19 2006/12/06 23:54:53 wrog
+ * Fix compiler warnings about undefined behavior (bv assigned twice in JUMP(READ_BYTES(...))) and unused values
+ *
* Revision 1.18 2006/09/26 02:03:59 pschwan
* b=1552816
* r=ben