-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
"SyntaxError: invalid increment operand" on Firefox #2314
Comments
Not sure if it will be of any help but here is the line on which we get the error : |
This gets printed to web console at app startup time? Can you extract the issue into a small test case? |
Try building with -g2 to get a more readable version of the output that is not minified. |
Yes it does get printed on the console at startup. I'll try to use g2 to get a more precise location of the problem |
Ok there you go : I'll also try to find the corresponding function in our c++ code |
I've got the corresponding function, but the js function does 2000 lines, so it's not exactly ideal to pinpoint the problem :/ |
The corresponding C++ code is here: https://github.com/aerys/minko/blob/master/framework/src/minko/file/EffectParser.cpp#L290 |
Another piece of information : there's only one ++0 in all of the generated js file, and replacing it by 1 makes it work on Firefox |
Can you either give me a simple command to build that file by itself, or a link to the bitcode file? Either would allow me to reproduce the problem locally. |
Hello, here is a link to the bitcode file that should hold the function: https://dl.dropboxusercontent.com/u/39247193/libminko-framework.a It's the library for the Minko core framework. You can build it yourself using the following documentation: http://doc.v3.minko.io/wiki/Compiling_the_SDK_for_HTML5 Regards, |
Compiling that bitcode file with -O2 does not produce the bug. Do I need specific flags to build with? |
thanks for your help! flags for em++: -O2 -MMD -MP flags for emcc: -O2 --closure 1 -s CLOSURE_ANNOTATIONS=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s DISABLE_EXCEPTION_CACHING=0 -s TOTAL_MEMORY=268435456 |
I still can't reproduce,
Does that fail on your machine? |
It does work, but this is not a good test :
We'll try to isolate the problem. |
Hello, the error now happens in Chrome 35 too (did not happen with Chrome 34) with a different message: "Uncaught ReferenceError: Invalid left-hand side expression in prefix operation" You can see it live here: http://showcase.minko.io/assimp/index.html This is now a major problem since our apps won't work in any up-to-date browser. Regards, |
In previous comment you mentioned that the repro kripken tried did not work. Do you have a full commandline that could be tried that is a good repro? |
kripken's test only generates the bytecode but it seams the invalid "++0" is added during the compilation of the final JS code. Here is our command line:
The main problem is that the code base is pretty large and disabling some libraries will make the "++0" disapear without any reason (the problematic code originates from libminko-framework.a which is always the same...). Here is how we compile everything in HTML5 using Emscripten + Premake: http://doc.v3.minko.io/wiki/Compiling_the_SDK_for_HTML5 Thanks for your help! |
For people with the same problem, we currently use a workaround with a Python script called on the generated JS file:
We use Premake's post-build commands to call "python fix.py invalid-file.js". Regards, |
Can you provide that .bc file in the emcc command 2 comments back? Then I can try it locally. |
Sure! Here you go: https://dl.dropboxusercontent.com/u/39247193/minko-example-cube.bc Thanks again for your help! |
Thanks! Ok, I reduced this to a testcase which shows it is an odd bug resulting from a combination of undefined float in an invoke context, so we end up casting twice, +(+0), which turns into ++0 and breaks us. Fixed on incoming. |
Thanks! |
With emsdk version 1.13 and 1.16, on Firefox 28.0 on Windows, we are getting the following error :
SyntaxError: invalid increment operand
It used to work with an older version of Emscripten.
The text was updated successfully, but these errors were encountered: