codegen.c: mrb_prev_pc can return NULL at the top of iseq.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2021-08-13 10:02:01 +09:00
parent 013365498d
commit cbdc4f2c5c
+2 -1
View File
@@ -323,12 +323,13 @@ struct mrb_insn_data
mrb_decode_insn(const mrb_code *pc)
{
struct mrb_insn_data data = { 0 };
data.addr = pc;
if (pc == 0) return data;
mrb_code insn = READ_B();
uint16_t a = 0;
uint16_t b = 0;
uint16_t c = 0;
data.addr = pc;
switch (insn) {
#define FETCH_Z() /* empty */
#define OPCODE(i,x) case OP_ ## i: FETCH_ ## x (); break;