Commit efd10742 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

widl: Issue an error instead of crashing for dividing by zero in a constant expression.

parent c46fcfb3
......@@ -1237,6 +1237,10 @@ static expr_t *make_expr2(enum expr_type type, expr_t *expr1, expr_t *expr2)
e->cval = expr1->cval * expr2->cval;
break;
case EXPR_DIV:
if (expr2->cval == 0) {
error_loc("divide by zero in expression\n");
e->cval = 0;
} else
e->cval = expr1->cval / expr2->cval;
break;
case EXPR_OR:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment