_gfxGetStackState and _gfxGetStackStateInFn are not guarded against inlining wich breaks the detection algorithm in some cases. Not having them static helps but is far from a garanty. I have hit this isse with -flto -Oz on gcc for example. A __attribute__ ((noinline)) fixed it.