mirror of
https://github.com/rkujawa/rk65c02.git
synced 2024-09-23 03:04:56 +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);
|
bus_access_device(t, addr, &d, &off);
|
||||||
|
|
||||||
if (d == NULL)
|
if (d == NULL)
|
||||||
return 0xFF;
|
return 0xFF; /* simulate floting pins */
|
||||||
else
|
else
|
||||||
val = d->read_1(d, off);
|
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);
|
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)
|
if (t->access_debug)
|
||||||
rk65c02_log(LOG_DEBUG, "bus WRITE @ %x (off %x) value %x\n",
|
rk65c02_log(LOG_DEBUG, "bus WRITE @ %x (off %x) value %x\n",
|
||||||
addr, off, val);
|
addr, off, val);
|
||||||
|
Loading…
Reference in New Issue
Block a user