if (lhs->type->is_array() &&
(rhs_var || rhs_const) &&
(!rhs_var ||
- var->type->without_array()->is_16bit() !=
- rhs_var->type->without_array()->is_16bit()) &&
+ (var &&
+ var->type->without_array()->is_16bit() !=
+ rhs_var->type->without_array()->is_16bit())) &&
(!rhs_const ||
- (var->type->without_array()->is_16bit() &&
+ (var &&
+ var->type->without_array()->is_16bit() &&
rhs_const->type->without_array()->is_32bit()))) {
assert(ir->rhs->type->is_array());
}
/* Fix array assignments from non-lowered to lowered. */
- if (_mesa_set_search(lower_vars, var) &&
+ if (var &&
+ _mesa_set_search(lower_vars, var) &&
ir->rhs->type->without_array()->is_32bit()) {
fix_types_in_deref_chain(lhs);
/* Convert to 16 bits for LHS. */
}
/* Fix assignment types. */
- if (_mesa_set_search(lower_vars, var)) {
+ if (var &&
+ _mesa_set_search(lower_vars, var)) {
/* Fix the LHS type. */
if (lhs->type->without_array()->is_32bit())
fix_types_in_deref_chain(lhs);
ir_variable *var = deref->variable_referenced();
/* Fix the type of the return value. */
- if (_mesa_set_search(lower_vars, var) &&
+ if (var &&
+ _mesa_set_search(lower_vars, var) &&
deref->type->without_array()->is_32bit()) {
/* Create a 32-bit temporary variable. */
ir_variable *new_var =
expr->operation == ir_unop_u2u) &&
expr->type->without_array()->is_16bit() &&
expr_op0_deref->type->without_array()->is_32bit() &&
+ expr_op0_deref->variable_referenced() &&
_mesa_set_search(lower_vars, expr_op0_deref->variable_referenced())) {
fix_types_in_deref_chain(expr_op0_deref);
if (deref) {
ir_variable *var = deref->variable_referenced();
- assert(var);
- if (_mesa_set_search(lower_vars, var) &&
+ /* var can be NULL if we are dereferencing ir_constant. */
+ if (var &&
+ _mesa_set_search(lower_vars, var) &&
deref->type->without_array()->is_32bit()) {
fix_types_in_deref_chain(deref);
ir_variable *var = param_deref->variable_referenced();
- if (_mesa_set_search(lower_vars, var) &&
+ /* var can be NULL if we are dereferencing ir_constant. */
+ if (var &&
+ _mesa_set_search(lower_vars, var) &&
param->type->without_array()->is_32bit()) {
fix_types_in_deref_chain(param_deref);