This fixes a crash when a move instruction moves an address of a global int
variable into a 64-bit register, as a MemAccessSize of 8 bytes was assumed.
The following code triggers this issue:
int x = 4;
test(&x);
The &x is compiled to
movabs rdi, 2111952
call test
Since no memory access size was set for MOV64ri, the code used the destination registers size to calculate MemAccessSizeInBytes. Since this is greater than SymbSize, this assertion failed.
We now set MemAccessSize to SymbSize if SymbSize is less than MemAccessSize.
This fixes a crash when a move instruction moves an address of a global int variable into a 64-bit register, as a MemAccessSize of 8 bytes was assumed.
The following code triggers this issue:
The
&x
is compiled toSince no memory access size was set for
MOV64ri
, the code used the destination registers size to calculateMemAccessSizeInBytes
. Since this is greater thanSymbSize
, this assertion failed.We now set
MemAccessSize
toSymbSize
ifSymbSize
is less thanMemAccessSize
.