mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
Arm64Emitter: Get rid of a pointer cast within SetJumpTarget()
Type punning like this is undefined behavior. Instead, we use std::memcpy to copy the necessary data over, which is well defined (as it treats both the source and destination as unsigned char).
This commit is contained in:
parent
fb382e90eb
commit
67b015d76b
@ -969,7 +969,8 @@ void ARM64XEmitter::SetJumpTarget(FixupBranch const& branch)
|
||||
inst = (0x25 << 26) | MaskImm26(distance);
|
||||
break;
|
||||
}
|
||||
*(u32*)branch.ptr = inst;
|
||||
|
||||
std::memcpy(branch.ptr, &inst, sizeof(inst));
|
||||
}
|
||||
|
||||
FixupBranch ARM64XEmitter::CBZ(ARM64Reg Rt)
|
||||
|
Loading…
Reference in New Issue
Block a user