minor constification
minor formatting fix
don't let -r code refer to locals

-r code cannot refer to locals, because we can't emit the
function header stuff
add a test case as well