summaryrefslogtreecommitdiff
path: root/usr/src/tools/smatch/src/check_double_checking.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/tools/smatch/src/check_double_checking.c')
-rw-r--r--usr/src/tools/smatch/src/check_double_checking.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr/src/tools/smatch/src/check_double_checking.c b/usr/src/tools/smatch/src/check_double_checking.c
index 83d10fd1c2..e1dc805308 100644
--- a/usr/src/tools/smatch/src/check_double_checking.c
+++ b/usr/src/tools/smatch/src/check_double_checking.c
@@ -47,9 +47,9 @@ static struct expression *strip_condition(struct expression *expr)
if (expr->type == EXPR_COMPARE &&
(expr->op == SPECIAL_EQUAL ||
expr->op == SPECIAL_NOTEQUAL)) {
- if (is_zero(expr->left))
+ if (expr_is_zero(expr->left))
return strip_condition(expr->right);
- if (is_zero(expr->right))
+ if (expr_is_zero(expr->right))
return strip_condition(expr->left);
}
@@ -131,6 +131,9 @@ static int previous_statement_was_synchronize(void)
struct position prev_pos;
char *ident;
+ if (!__cur_stmt)
+ return 0;
+
if (__prev_stmt) {
prev_pos = __prev_stmt->pos;
prev_pos.line -= 3;