On Mon Nov 13 13:00:55 2023 +0000, Giovanni Mascellani wrote:
Sure, it's not much trouble. Though I basically see that as two instructions sharing the same handler: I'd expect that every time you find a `switch` you have to check what `case_count` is (or assume it in case one of two alternatives is illegal given the context), because the two cases are completely different. So at that point I find it simpler to just allocate two different handlers.
I'll add that `case_count == 0` (with or without a default case) is probably a bit silly, but not necessarily illegal. In fact, this commit is going to generate one such `switch` instruction if the TPF program has an empty switch construct (which is not forbidden, AFAIA), making the generated program illegal because there is no corresponding `endswitch`.