Ignore nullptr access for volatile data

This commit is contained in:
drmortalwombat 2025-04-24 15:31:39 +02:00
parent da4a90b724
commit f0a7499814

View File

@ -5234,7 +5234,7 @@ void NativeCodeInstruction::Assemble(NativeCodeBasicBlock* block)
} }
else else
{ {
if (mAddress == 0) if (mAddress == 0 && !(mFlags & NCIF_VOLATILE))
block->mProc->mGenerator->mErrors->Error(mIns->mLocation, EWARN_NULL_POINTER_DEREFERENCED, "nullptr dereferenced"); block->mProc->mGenerator->mErrors->Error(mIns->mLocation, EWARN_NULL_POINTER_DEREFERENCED, "nullptr dereferenced");
block->PutByte(uint8(mAddress)); block->PutByte(uint8(mAddress));
} }
@ -5302,7 +5302,7 @@ void NativeCodeInstruction::Assemble(NativeCodeBasicBlock* block)
} }
else else
{ {
if (mAddress == 0) if (mAddress == 0 && !(mFlags & NCIF_VOLATILE))
block->mProc->mGenerator->mErrors->Error(mIns->mLocation, EWARN_NULL_POINTER_DEREFERENCED, "nullptr dereferenced"); block->mProc->mGenerator->mErrors->Error(mIns->mLocation, EWARN_NULL_POINTER_DEREFERENCED, "nullptr dereferenced");
block->PutWord(uint16(mAddress)); block->PutWord(uint16(mAddress));
} }