What options did you compile with? And did you run anything on the JS afterwards?
That code sample looks a little like what closure compiler or another JS minifier might do. In emscripten, building with --closure 2 might lead to similar stuff - but we would disable asm.js validation in that case. If you run a minifier yourself on the output, without disabling that, then an error like this could occur. On Tue, Aug 28, 2018 at 2:22 PM Joe Bibbo <[email protected]> wrote: > > After successfully building and verifying the functionality of a large C++ > library, I was noticing that the code was running slower than expected. > The browser was putting up a warning about > the emscripten-generated asm.js "Invalid asm.js: Undefined global > variable" I tracked it down to the asm.js code, and any place that the > toolchain > had decided to use use a 'true' or 'false' constant. The browser would > complain ( chrome, firefox ). > > . > . > . > c[(F + 48 | 0) + 8 >> 2] = 674; > Kk(0, 0, 184863, F + 48 | 0); > Eb() > } > if (true ? (c[m + 8 >> 2] & 32 | 0) == 0 : 0) > if ((d[m + 4 >> 0] | 0) < 2) > a = 36; > else > a = 37; > else > a = 36; > > . > > > > > Building on mac, > emcc (Emscripten gcc/clang-like replacement) 1.38.5 (commit > a4474e59db658cea570c78254fa71119cf688db5) > > Any ideas on what I must do to avoid this type of generated code? > > Thanks in advance for any help or advice. > > Regards, > Joe > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
