Skip to content

Commit

Permalink
[FIX] fixing a bit of instuction encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Cr0a3 committed Aug 27, 2024
1 parent f27cfe7 commit 957afd1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/Obj/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,7 @@ impl ObjectBuilder {
if self.triple.getCallConv() == Ok(CallConv::WindowsFastCall) {
addend = match ty {
Decl::Function => 0,
Decl::Data => -1,
Decl::Constant => -1,
_ => -1,
};
offset = -4;
} else if self.triple.getCallConv() == Ok(CallConv::SystemV) {
Expand Down
6 changes: 3 additions & 3 deletions src/Target/x64/asm/instr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ impl Instr {
}
op.push(m);

if !mem.rex(true).empty() {
if !mem.rex(false).empty() {
if let Some(rext) = rex {
rex = Some(rext.sync(mem.rex(true)));
} else {rex = Some(mem.rex(true))}
rex = Some(rext.sync(mem.rex(false)));
} else {rex = Some(mem.rex(false))}
}

let enc = &mem.encode(Some(op0.boxed()));
Expand Down

0 comments on commit 957afd1

Please sign in to comment.