Undefined behavior results when R6 reaches student code, either by infinite recursion or huge recursion. Add some more intelligence to detect these scenarios and send a warning or halt execution.