-
-
Notifications
You must be signed in to change notification settings - Fork 661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
local static in inlined function gets optimized away with analyzer #11725
Comments
The optimization is a symptom, the real problem here must be the inliner. Without thinking about it too much, static vars should probably not be duplicated like normal vars when inlining. |
Actually I'm not entirely sure if static local variables should even be allowed in inline functions, but I'm basing that mostly on the fact that thinking about it makes my head hurt. |
Yeah it seems to be that the fix would be to disallow that.. but then what about call site inlining? Would still fail, right? |
For cases like here we can detect it at definition-level, for call-site inlining we have to detect it during inlining. |
I've made it error when inlining because that covers both cases and we do this for some other things like |
With analyzer turned on, and
inline
the variable won't exist. Removinginline
or disabling analyzer makes it work. Reproducible on all Haxe versions it seems.Compiles down to:
The text was updated successfully, but these errors were encountered: