dingusdev / dingusppc

An experimental emulator
GNU General Public License v3.0
200 stars 21 forks source link

Avoid some undefined behavior #72

Closed mihaip closed 6 months ago

mihaip commented 6 months ago

The SubOpcode31Grabber[1024] = { ppc_illegalop } initializer only populates the first entry with ppc_illegalop (at least on some compilers), switch to explicitly initializing the entire array with std::fill_n.

Also fix a couple of sign and overflow issues flagged by the Xcode undefined behavior sanitizer.