Avoid NPE in ast nodes visit
Restore old context in codegen_fun, not when invoking it