Content-Length: 210701 | pFad | https://github.com/neilbrown/smatch/commit/4c03b3771adf

CB check_safe_pointers: warn if non-safe is assigned to safe variable. · neilbrown/smatch@4c03b37 · GitHub
Skip to content

Commit

Permalink
check_safe_pointers: warn if non-safe is assigned to safe variable.
Browse files Browse the repository at this point in the history
Signed-off-by: NeilBrown <neil@brown.name>
  • Loading branch information
neilbrown committed Aug 1, 2016
1 parent cf1abbe commit 4c03b37
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions check_safe_pointers.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,17 @@ static void match_assign(struct expression *expr)
set_state_expr(my_id, expr->left, &safe);
else
set_state_expr(my_id, expr->left, &undefined);

if (is_safe(expr->left) && !is_safe_expr(expr->right)) {
char *namel, *namer;

namel = expr_to_str(expr->left);
namer = expr_to_str(expr->right);
sm_msg("'%s' can only take 'safe' pointers, not '%s'",
namel, namer);
free_string(namel);
free_string(namer);
}
}

void check_safe_pointers(int id)
Expand Down

0 comments on commit 4c03b37

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/neilbrown/smatch/commit/4c03b3771adf

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy