tinyvm
tinyvm copied to clipboard
Improve error handling while parsing
Thanks for your work! There are a couple of things I see that can be improved, especially error handling. Tinyvm doesn't seem to check whether given instructions are correct or not, and it simply parses any kind of file (even an empty one) which results in a segfault. Maybe check if there's any matching token that exists or not and then parse? Besides, tinyvm also doesn't handle errors if an instruction register is missing or incomplete, e.g. instead of add eax, 1 if we just give add vm will get a segfault. Also, instructions like ret result in segfault (not sure what causes it).