-
Notifications
You must be signed in to change notification settings - Fork 107
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
[neko] Uncaught exception - load.c(398) : Invalid module #283
Comments
I'm assigning 4.3 because while this is neko and probably some weird corner case, I'm actually quite curious what happens here. |
Sadly, I don't have the time to look into this for 4.3. |
The problem is that the Int64 code generates a lot of local variables in the same function scope. This issue can also be reproduced with this sample: @:analyzer(no_optimize)
function main() {
var _:Int; // 1
var _:Int; // 2
var _:Int; // 3
...
var _:Int; // 124 - this line goes over the limit
} Neko has a stack limit size of 124 per scope, and defining this many local variables exceeds this stack limit, which causes the bytecode checks to fail. https://github.com/HaxeFoundation/neko/blob/master/vm/module.c#L143-L144 This isn't exclusive to Haxe. It's possible to write native Neko code that also triggers this failure. It can be worked around by splitting the code into separate scopes using I don't see Haxe being able to do much about this, apart from maybe optimising the haxe.Int64 code to generate fewer temporary variables (right now it generates a lot for I guess the Neko error could also be a bit more specific as well. |
I'll transfer this to neko because if anything, we'll improve the error message. |
The following code return the error
Uncaught exception - load.c(398) : Invalid module : bin/unit.n
for neko target ( 2.2.0 , 2.3.0 and 2.3.1 )If you comment the last row
var t1:....
ort0
it's start to compile .The text was updated successfully, but these errors were encountered: