Closed jfkthame closed 8 years ago
I don't know if this helps but I would like to see a cast of opc to opcode in the switch of Machine::Code::decoder::fetch_opcode, or else perhaps a const opcode = opcode(bopc) and bopc = *bc++ or whatever.
Merged manually with minor change as per comment above
Assigning an arbitrary byte value to an
opcode
variable may result in undefined behavior, because of the limited range of the enum type. So use abyte
variable for the value read from the font until it has been validated and confirmed to be a valid opcode.