If there are no opcodes then just delete the code space.
If there are no opcodes then the various checks access an undefined opcode, so just delete the code space for this case.
This commit is contained in:
parent
59c4209347
commit
8f6062799e
|
|
@ -101,6 +101,12 @@ void codespace_delete(void)
|
||||||
{
|
{
|
||||||
vvp_code_t cur = first_chunk;
|
vvp_code_t cur = first_chunk;
|
||||||
|
|
||||||
|
/* If there are no opcodes then just delete the code space. */
|
||||||
|
if (count_opcodes == 0) {
|
||||||
|
delete [] cur;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
vvp_code_t next = cur[code_chunk_size-1].cptr;
|
vvp_code_t next = cur[code_chunk_size-1].cptr;
|
||||||
for (unsigned idx = 0 ; idx < code_chunk_size; idx += 1) {
|
for (unsigned idx = 0 ; idx < code_chunk_size; idx += 1) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue