This chunk of code
|
*p++ = 0x68; |
|
*(INT32 *)p = arg; |
|
p += 4; |
|
|
|
// push arg2 |
|
*p++ = 0x68; |
|
*(INT32 *)p = arg2; |
|
p += 4; |
definitely have undefined behavior because there are misaligned INT32 memory writes. This issue may also occur in other places in this file.
Clang with
-fsanitize=undefined can catch this:
https://godbolt.org/z/EeEzvfWsj
This chunk of code
runtime/src/coreclr/vm/i386/cgenx86.cpp
Lines 973 to 980 in 1e322fd
definitely have undefined behavior because there are misaligned INT32 memory writes. This issue may also occur in other places in this file.
Clang with
-fsanitize=undefinedcan catch this: https://godbolt.org/z/EeEzvfWsj