Skip to content

Commit

Permalink
#60 Start adding error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
dibyendumajumdar committed Jul 10, 2021
1 parent 15bb162 commit 2fcad6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2370,12 +2370,12 @@ static int emit_op_init(struct function *fn, Instruction *insn)
Pseudo *dst = get_first_target(insn);
Pseudo src = { PSEUDO_NIL };
if (dst->type == PSEUDO_TEMP_FLT) {
Constant zerof = { RAVI_TNUMINT, 0, { 0.0 }};
Constant zerof = { .type = RAVI_TNUMINT, .index = 0, .n = 0.0 };
src.type = PSEUDO_CONSTANT;
src.constant = &zerof;
emit_move(fn, &src, dst);
} else if (dst->type == PSEUDO_TEMP_INT || dst->type == PSEUDO_TEMP_BOOL) {
Constant zeroi = { RAVI_TNUMINT, 0, { 0 }};
Constant zeroi = { .type = RAVI_TNUMINT, .index = 0, .i = 0 };
src.type = PSEUDO_CONSTANT;
src.constant = &zeroi;
emit_move(fn, &src, dst);
Expand Down

0 comments on commit 2fcad6b

Please sign in to comment.