Colby-CPU-Sim / CPUSim

GNU General Public License v3.0
52 stars 18 forks source link

Replace all uses of `assert` with Exceptions #96

Open Nava2 opened 7 years ago

Nava2 commented 7 years ago

assert is widely considered bad. It corrupts the stack and does not behave "appropriately."

All assert messages should be replaced with this or equivalent:

From:

assert module instanceof RegisterArray :
               "Passed non-RegisterArray to RegisterArray.copyDataTo()" ;

To:

checkArgument(module instanceof RegisterArray, "Passed non-RegisterArray to RegisterArray.copyDataTo()");