From f0a7499814c3daa781526d94c76d77599c9370f3 Mon Sep 17 00:00:00 2001 From: drmortalwombat <90205530+drmortalwombat@users.noreply.github.com> Date: Thu, 24 Apr 2025 15:31:39 +0200 Subject: [PATCH] Ignore nullptr access for volatile data --- oscar64/NativeCodeGenerator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oscar64/NativeCodeGenerator.cpp b/oscar64/NativeCodeGenerator.cpp index 762ff9d..f5dca4e 100644 --- a/oscar64/NativeCodeGenerator.cpp +++ b/oscar64/NativeCodeGenerator.cpp @@ -5234,7 +5234,7 @@ void NativeCodeInstruction::Assemble(NativeCodeBasicBlock* block) } else { - if (mAddress == 0) + if (mAddress == 0 && !(mFlags & NCIF_VOLATILE)) block->mProc->mGenerator->mErrors->Error(mIns->mLocation, EWARN_NULL_POINTER_DEREFERENCED, "nullptr dereferenced"); block->PutByte(uint8(mAddress)); } @@ -5302,7 +5302,7 @@ void NativeCodeInstruction::Assemble(NativeCodeBasicBlock* block) } else { - if (mAddress == 0) + if (mAddress == 0 && !(mFlags & NCIF_VOLATILE)) block->mProc->mGenerator->mErrors->Error(mIns->mLocation, EWARN_NULL_POINTER_DEREFERENCED, "nullptr dereferenced"); block->PutWord(uint16(mAddress)); }