Fix the -fcorrect-logic condition

This commit is contained in:
Wolfgang Bumiller 2012-12-20 20:40:59 +01:00
parent 0988b731b7
commit 68c4070f62

View file

@ -1910,8 +1910,10 @@ static ast_expression* process_condition(parser_t *parser, ast_expression *cond,
}
ifnot = !ifnot;
}
if (OPTS_FLAG(CORRECT_LOGIC)) {
/* everything must use a NOT_ */
if (OPTS_FLAG(CORRECT_LOGIC) &&
!(cond->expression.vtype == TYPE_STRING && OPTS_FLAG(TRUE_EMPTY_STRINGS)))
{
/* non-floats need to use NOT; except for strings on -ftrue-empty-strings */
unary = (ast_unary*)cond;
if (!ast_istype(cond, ast_unary) || unary->op < INSTR_NOT_F || unary->op > INSTR_NOT_FNC)
{