[plugin] add workaround for recursive typedef overflow#878
[plugin] add workaround for recursive typedef overflow#878yuxiaomao wants to merge 1 commit intoHaxeFoundation:masterfrom
Conversation
|
It might be good to have this failsafe here, but this should really be fixed in the code generation. See HaxeFoundation/haxe#12539 |
|
I remember well that one, but I still don't know what to do ^^' |
|
I somehow thought this was already fixed but either way, let's discuss that further over there. As for this, isn't 10 a bit low? |
|
I tried in haxe but never successed :< Maybe if we fix there, this problem will no longer exists. I'll probably not merge this yet, until I find a fix or workaround for my other bug. As this is plugin-only, I didn't really think about how deep should I check (I can set it to 20 or more if you prefer, but I hope that most people doesn't write a very deep and non-recursive typedef) |
|
That does not seem like a good fix :) could we instead mark temporarily the ->type value with -1 while we recurse and restore it after so we check for strict equality ? |
Repro with
-dce no.Stack overflow when comparing types, e.g. haxe.ds.StringMap hvirtual - hmethod. This PR suggest to workaround the problem by stop checking when recursion is too deep.
However there's still another plugin bug that, excluded functions calls (at least some of them in fun$init) are not replaced by the base version of the function. Repro with
--macro exclude("Type")(Edit: any static call that are excluded). I didn't find how to fix yet ^^'