From f4e5baa44408feeb7a1f0e6de2ea66adf3d8f81a Mon Sep 17 00:00:00 2001 From: cuz Date: Sun, 14 Sep 2003 11:12:27 +0000 Subject: [PATCH] Fixed a bug git-svn-id: svn://svn.cc65.org/cc65/trunk@2437 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/expr.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/cc65/expr.c b/src/cc65/expr.c index feb76482d..43df6bfa4 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -444,7 +444,10 @@ void ExprLoad (unsigned Flags, int k, ExprDesc* Expr) } else if (f != E_MREG) { /* Reference with address in primary */ g_getind (Flags, 0); - } + } else if (Flags & CF_TEST) { + /* The value is already in the primary but needs a test */ + g_test (Flags); + } } else { /* An rvalue */ if (f == E_MEOFFS) { @@ -455,14 +458,14 @@ void ExprLoad (unsigned Flags, int k, ExprDesc* Expr) /* Constant of some sort, load it into the primary */ LoadConstant (Flags, Expr); } - } - /* Are we testing this value? */ - if (Expr->Test & E_FORCETEST) { - /* Yes, force a test */ - Flags |= TypeOf (Expr->Type); - g_test (Flags); - Expr->Test &= ~E_FORCETEST; + /* Are we testing this value? */ + if (Expr->Test & E_FORCETEST) { + /* Yes, force a test */ + Flags |= TypeOf (Expr->Type); + g_test (Flags); + Expr->Test &= ~E_FORCETEST; + } } } -- 2.39.5