diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-07-04 14:45:31 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-02-01 18:06:18 +0100 |
| commit | ad7c788e7a5b66b05a4cc8b7df35ffcec1ce5d49 (patch) | |
| tree | 7bed08082a26de3a4a55215f1a6d90a1777edf2b | |
| parent | 3a8d5ac8681871e44062965566f9211a8d302da4 (diff) | |
| download | sparse-dev-ad7c788e7a5b66b05a4cc8b7df35ffcec1ce5d49.tar.gz | |
add helpers: valid_expr_type() & valid_subexpr_type()
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
| -rw-r--r-- | evaluate.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -47,6 +47,17 @@ struct symbol *current_fn; static struct symbol *degenerate(struct expression *expr); static struct symbol *evaluate_symbol(struct symbol *sym); +static inline int valid_expr_type(struct expression *expr) +{ + return expr && valid_type(expr->ctype); +} + +static inline int valid_subexpr_type(struct expression *expr) +{ + return valid_expr_type(expr->left) + && valid_expr_type(expr->right); +} + static struct symbol *evaluate_symbol_expression(struct expression *expr) { struct expression *addr; |
