Skip to content

Misaligned memory writes at src/coreclr/vm/i386/cgenx86.cpp #118602

@j123123

Description

@j123123

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions