Returning null from callback invoked in CallbackFunction causes NullReferenceException
ThisIsNoZaku opened this issue · comments
In Processor_InstructionLoop.cs, if the CLR function wrapped by a CallbackFunction returns null, that null is pushed on the value stack and the processor proceeds on to call Internal_CheckForTailRequests. In Internal_CheckForTailRequests, a check of the type is attempted, causeing a NullReferenceException to be thrown.
At the very least, I believe Internal_CheckForTailRequests should do a null check and give a explanatory message. A better solution, in my opinion, is that the null should cause Nil to be pushed onto the stack instead.