Damn. If I don't build in debug mode I get an unhandled memory exception error when I try to call the function. The pointer is valid, and I can call the function when running in debug mode, and I can see the effect. If it's not in debug mode, it crashes.
Building test Compiling:test.bmx flat assembler version 1.64 3 passes, 13288 bytes. Linking:test.exe Executing:test.exe Unhandled Memory Exception Error Process complete