Skip to content

Commit

Permalink
Update build.c
Browse files Browse the repository at this point in the history
  • Loading branch information
john-h-k committed Dec 10, 2024
1 parent 198ef65 commit 10c5b42
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ir/build.c
Original file line number Diff line number Diff line change
Expand Up @@ -2836,6 +2836,12 @@ static void validate_op_tys_callback(struct ir_op **op, void *cb_metadata) {
case IR_OP_TY_CAST_OP:
res_ty = consumer->var_ty;
break;
case IR_OP_TY_UNARY_OP:
if (consumer->unary_op.ty == IR_OP_UNARY_OP_TY_LOGICAL_NOT && var_ty_is_integral(&consumer->var_ty) && var_ty_is_integral(&res_ty)) {
// logical not on other-sized int is fine
res_ty = consumer->var_ty;
}
break;
case IR_OP_TY_ADDR:
res_ty = IR_VAR_TY_POINTER;
break;
Expand Down

0 comments on commit 10c5b42

Please sign in to comment.