/* Break out if operand types were not parsed successfully. */
if ((op[0]->type == glsl_type::error_type ||
- op[1]->type == glsl_type::error_type))
+ op[1]->type == glsl_type::error_type)) {
+ type = glsl_type::error_type;
+ error_emitted = true;
break;
+ }
type = arithmetic_result_type(op[0], op[1],
(this->oper == ast_mul_assign),
}
}
type = NULL; /* use result->type, not type. */
- assert(result != NULL || !needs_rvalue);
+ assert(error_emitted || (result != NULL || !needs_rvalue));
if (result && result->type->is_error() && !error_emitted)
_mesa_glsl_error(& loc, state, "type mismatch");