Of course after I post this I realize the answer. The function only works when the surrounding function has at least one argument. Probably has something to do with the way the compiler emits no-argument functions, I'll have to look at some disassembly.