Skip to content

Commit

Permalink
compiler: fix code generation for divison operator
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Feb 23, 2024
1 parent 1abd1b0 commit c60d128
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/julec/obj/cxx/expr.jule
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,11 @@ impl ExprCoder {

fn binary(mut self, mut m: &BinopExprModel): str {
match m.op.kind {
| TokenKind.Solidus
| TokenKind.Percent:
ret self.div_by_zero_binary(m.op, m.left, m.right)
| TokenKind.Solidus | TokenKind.Percent:
// Do not check division of structures safety.
if m.left.kind.strct() == nil {
ret self.div_by_zero_binary(m.op, m.left, m.right)
}
}

let mut obj = "("
Expand Down

0 comments on commit c60d128

Please sign in to comment.