This commit is contained in:
julianb0 2019-06-16 12:21:18 +02:00
parent ed03945762
commit 08b931e911
No known key found for this signature in database
GPG Key ID: DDF8325C95299A62
1 changed files with 13 additions and 7 deletions

View File

@ -12,17 +12,23 @@ static ushort *fwprog;
ushort bget(ctx_t *ctx)
{
if (rip % 2) {
_except(ctx, E_ALI, "Misaligned RIP register: 0x%016lX",
rip);
ulong addr = rip + cr1;
if (addr % 2) {
_except(ctx, E_ALI, "Misaligned RIP and/or CR1: "
"rip=0x%lX cr1=0x%lX",
rip, cr1);
}
if (addr2real(rip) >= ctx->mz) {
_except(ctx, E_ACC, "Executing out of memory: 0x%016lX",
rip);
if (addr2real(addr) >= ctx->mz) {
_except(ctx, E_ACC, "Executing out of memory: "
"rip=0x%lX cr1=0x%lX",
rip, cr1);
}
ushort c = ctx->mp[addr2real(rip)];
ushort c = ctx->mp[addr2real(addr)];
rip += 2;