Skip to content

Commit

Permalink
fix(codegen): mov into bigger location without checking if it's new
Browse files Browse the repository at this point in the history
  • Loading branch information
MilkeeyCat committed Oct 21, 2024
1 parent c2c0c42 commit c04a49a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/codegen/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,14 +326,15 @@ impl CodeGen {

self.expr(*cast_expr.expr, Some(&r.dest(og_size)), state)?;

if casted_size > og_size {
self.arch.mov(
&r.source(og_size),
&r.dest(casted_size),
type_.signed(),
)?;
}

if new {
if casted_size > og_size {
self.arch.mov(
&r.source(og_size),
&r.dest(casted_size),
type_.signed(),
)?;
}
self.arch
.mov(&r.source(casted_size), dest, type_.signed())?;
self.arch.free(r)?;
Expand Down

0 comments on commit c04a49a

Please sign in to comment.