Skip to content

Commit

Permalink
fix(codegen): use common type beween two operands when perform compar…
Browse files Browse the repository at this point in the history
…ison

fixes #80
  • Loading branch information
MilkeeyCat committed Oct 13, 2024
1 parent 1d69544 commit 6a15f56
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/codegen/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,9 @@ impl CodeGen {
| BinOp::Equal
| BinOp::NotEqual => {
if let Some(dest) = dest {
let size = self
.arch
.size(&Type::common_type(left_type, right_type), &self.scope);
let left = self.arch.alloc()?;
let right = self.arch.alloc()?;

Expand Down

0 comments on commit 6a15f56

Please sign in to comment.