mirror of
https://github.com/rkujawa/rk65c02.git
synced 2024-12-13 01:29:57 +00:00
Avoid null pointer dereference.
This commit is contained in:
parent
8e89ed067a
commit
23730825fb
@ -118,7 +118,7 @@ bus_read_1(bus_t *t, uint16_t addr)
|
||||
bus_access_device(t, addr, &d, &off);
|
||||
|
||||
if (d == NULL)
|
||||
return 0xFF;
|
||||
return 0xFF; /* simulate floting pins */
|
||||
else
|
||||
val = d->read_1(d, off);
|
||||
|
||||
@ -139,6 +139,13 @@ bus_write_1(bus_t *t, uint16_t addr, uint8_t val)
|
||||
|
||||
bus_access_device(t, addr, &d, &off);
|
||||
|
||||
if (d == NULL) {
|
||||
if (t->access_debug)
|
||||
rk65c02_log(LOG_DEBUG, "unmapped bus WRITE @ %x (off %x) value %x\n",
|
||||
addr, off, val);
|
||||
return;
|
||||
}
|
||||
|
||||
if (t->access_debug)
|
||||
rk65c02_log(LOG_DEBUG, "bus WRITE @ %x (off %x) value %x\n",
|
||||
addr, off, val);
|
||||
|
Loading…
Reference in New Issue
Block a user