YJIT: Fix getting the EP with registers other than RAX (#5882)

Before this commit we were accidentally clobbering RAX.  Additionally,
since this function had RAX hardcoded then the function may not have
worked with registers other than RAX.

Co-authored-by: John Hawthorn <john@hawthorn.email>
This commit is contained in:
Aaron Patterson 2022-05-12 12:08:35 -07:00 коммит произвёл GitHub
Родитель 7522343351
Коммит f07a0e79a2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -1477,7 +1477,7 @@ fn gen_get_ep(cb: &mut CodeBlock, reg: X86Opnd, level: u32) {
// See GET_PREV_EP(ep) macro
// VALUE *prev_ep = ((VALUE *)((ep)[VM_ENV_DATA_INDEX_SPECVAL] & ~0x03))
let offs = (SIZEOF_VALUE as i32) * (VM_ENV_DATA_INDEX_SPECVAL as i32);
mov(cb, reg, mem_opnd(64, REG0, offs));
mov(cb, reg, mem_opnd(64, reg, offs));
and(cb, reg, imm_opnd(!0x03));
}
}