Skip to content

[RISC-V] Remove unnecessary assertion from emitOutputInstr #98484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/coreclr/jit/emitriscv64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2118,8 +2118,8 @@ void emitter::emitJumpDistBind()
unsigned emitter::emitOutput_Instr(BYTE* dst, code_t code) const
{
assert(dst != nullptr);
assert(sizeof(code_t) == 4);
memcpy(dst + writeableOffset, &code, sizeof(code_t));
static_assert(sizeof(code_t) == 4, "code_t must be 4 bytes");
memcpy(dst + writeableOffset, &code, sizeof(code));
return sizeof(code_t);
}

Expand Down Expand Up @@ -3157,8 +3157,7 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp)
instruction ins;
size_t sz = 0;

assert(REG_NA == static_cast<int>(REG_NA));
assert(writeableOffset == 0);
static_assert(REG_NA == static_cast<int>(REG_NA), "REG_NA must fit in an int");

insOpts insOp = id->idInsOpt();

Expand Down