Fixed AND/OR in certain cases where the 'E_NEED_TEST' flag set for usage only in subexpressions should be cleared.
This commit is contained in:
@@ -3223,6 +3223,9 @@ static int hieAnd (ExprDesc* Expr, unsigned* TrueLab, int* TrueLabAllocated)
|
|||||||
/* Load the value */
|
/* Load the value */
|
||||||
LoadExpr (CF_FORCECHAR, Expr);
|
LoadExpr (CF_FORCECHAR, Expr);
|
||||||
|
|
||||||
|
/* Clear the test flag */
|
||||||
|
ED_RequireNoTest (Expr);
|
||||||
|
|
||||||
/* Remember that the jump is used */
|
/* Remember that the jump is used */
|
||||||
HasFalseJump = 1;
|
HasFalseJump = 1;
|
||||||
|
|
||||||
@@ -3356,6 +3359,9 @@ static void hieOr (ExprDesc *Expr)
|
|||||||
/* Get first expr */
|
/* Get first expr */
|
||||||
LoadExpr (CF_FORCECHAR, Expr);
|
LoadExpr (CF_FORCECHAR, Expr);
|
||||||
|
|
||||||
|
/* Clear the test flag */
|
||||||
|
ED_RequireNoTest (Expr);
|
||||||
|
|
||||||
if (HasTrueJump == 0) {
|
if (HasTrueJump == 0) {
|
||||||
/* Get a label that we will use for true expressions */
|
/* Get a label that we will use for true expressions */
|
||||||
TrueLab = GetLocalLabel();
|
TrueLab = GetLocalLabel();
|
||||||
|
|||||||
@@ -364,6 +364,16 @@ INLINE void ED_RequireTest (ExprDesc* Expr)
|
|||||||
# define ED_RequireTest(Expr) do { (Expr)->Flags |= E_NEED_TEST; } while (0)
|
# define ED_RequireTest(Expr) do { (Expr)->Flags |= E_NEED_TEST; } while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_INLINE)
|
||||||
|
INLINE void ED_RequireNoTest (ExprDesc* Expr)
|
||||||
|
/* Mark the expression not for a test. */
|
||||||
|
{
|
||||||
|
Expr->Flags &= ~E_NEED_TEST;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
# define ED_RequireNoTest(Expr) do { (Expr)->Flags &= ~E_NEED_TEST; } while (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_INLINE)
|
#if defined(HAVE_INLINE)
|
||||||
INLINE int ED_GetNeeds (const ExprDesc* Expr)
|
INLINE int ED_GetNeeds (const ExprDesc* Expr)
|
||||||
/* Get flags about what the expression needs. */
|
/* Get flags about what the expression needs. */
|
||||||
|
|||||||
Reference in New Issue
Block a user