Handle SP_INC of NULL

'return NULL' generates an SP_INC instruction with -1 as its argument.
This commit is contained in:
Nunuhara Cabbage
2019-12-04 20:13:13 -08:00
parent 1e01e1e5a7
commit 2d3bd9fff8
+2
View File
@@ -128,6 +128,8 @@ static void heap_free_slot(int32_t slot)
void heap_ref(int32_t slot)
{
if (slot == -1)
return;
heap[slot].ref++;
#ifdef DEBUG_HEAP
heap[slot].ref_addr = instr_ptr;