diff --git a/tools/qfcc/include/expr.h b/tools/qfcc/include/expr.h index f09d3df28..e2ef252ca 100644 --- a/tools/qfcc/include/expr.h +++ b/tools/qfcc/include/expr.h @@ -740,6 +740,8 @@ unsigned short expr_ushort (const expr_t *e) __attribute__((pure)); int expr_integral (const expr_t *e) __attribute__((pure)); +bool is_error (const expr_t *e) __attribute__((pure)); + /** Check if the expression refers to a constant value. \param e The expression to check. diff --git a/tools/qfcc/source/expr.c b/tools/qfcc/source/expr.c index 35a1c7f97..17ddd1766 100644 --- a/tools/qfcc/source/expr.c +++ b/tools/qfcc/source/expr.c @@ -861,6 +861,12 @@ new_short_expr (short short_val) return new_value_expr (new_short_val (short_val), false); } +bool +is_error (const expr_t *e) +{ + return e->type == ex_error; +} + int is_constant (const expr_t *e) {