From 941036615e0811c2b0cb5bfa10c6a72c88263c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kujawa?= Date: Thu, 2 Feb 2017 14:43:44 +0100 Subject: [PATCH] Add some null pointer checking asserts. --- src/rk65c02.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rk65c02.c b/src/rk65c02.c index 47226f6..ecd16b1 100644 --- a/src/rk65c02.c +++ b/src/rk65c02.c @@ -64,6 +64,8 @@ rk65c02_exec(rk65c02emu_t *e) void rk65c02_start(rk65c02emu_t *e) { + assert(e != NULL); + e->state = RUNNING; while (e->state == RUNNING) { rk65c02_exec(e); @@ -78,6 +80,8 @@ rk65c02_step(rk65c02emu_t *e, uint16_t steps) { uint16_t i = 0; + assert(e != NULL); + e->state = STEPPING; while ((e->state == STEPPING) && (i < steps)) { rk65c02_exec(e);