Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions