Skip to content
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

Internal Compiler Error : Unexpected token ILLEGAL, preprocessor #3929

Closed
ghost opened this issue Nov 23, 2015 · 3 comments
Closed

Internal Compiler Error : Unexpected token ILLEGAL, preprocessor #3929

ghost opened this issue Nov 23, 2015 · 3 comments
Labels

Comments

@ghost
Copy link

ghost commented Nov 23, 2015

i'm working on "library_signals.js",
but I think that this problem can also occur elsewhere.

if i insert 'tab' compiler crushes
about preprocessor directive

does not work :

        sigaction: function(signum, act, oldact) 
        {
        //int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact);
        #if ASSERTIONS
            signal__deps.printErr('Calling stub instead of sigaction()');
        #endif
            return 0;
        },

work :

    sigaction: function(signum, act, oldact) 
    {
    //int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact);
#if ASSERTIONS
    signal__deps.printErr('Calling stub instead of sigaction()');
#endif
        return 0;
    },

output error message

error: failure to execute js library "library_signals.js": SyntaxError: Unexpected token ILLEGAL,,SyntaxError: Unexpected token ILLEGAL
    at Object.LibraryManager.load (eval at globalEval (C:\Program Files\Emscripten\emscripten\1.35.0\src\compiler.js:105:8), <anonymous>:146:14)
    at JSify (eval at globalEval (C:\Program Files\Emscripten\emscripten\1.35.0\src\compiler.js:105:8), <anonymous>:61:20)
    at library_signals.js (C:\Program Files\Emscripten\emscripten\1.35.0\src\compiler.js:208:3)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:475:10)
    at startup (node.js:117:18)
    at node.js:951:3
preprocessed source (you can run a js engine on this to get a clearer error message sometimes):
=============
// 'use strict'
var funs = 
{
    signal__deps: ['_sig_handler_'], 

    signal: function(sig, func) 
    {
        if ( typeof signal__deps === 'undefined' ) signal__deps = [] ;
        if ( typeof signal__deps['_sig_handler_'] === 'undefined' ) signal__deps['_sig_handler_'] = [] ;
        signal__deps['_sig_handler_'][sig] = func ;

        return sig;
    },

    sigemptyset: function(set) 
    {
        HEAP32[((set)>>2)]=0;
        return 0;
    },
    sigfillset: function(set) 
    {
        HEAP32[((set)>>2)]=-1>>>0;
        return 0;
    },
    sigaddset: function(set, signum) 
    {
        HEAP32[((set)>>2)]=HEAP32[((set)>>2)]| (1 << (signum-1));
        return 0;
    },
    sigdelset: function(set, signum) 
    {
        HEAP32[((set)>>2)]=HEAP32[((set)>>2)]& (~(1 << (signum-1)));
        return 0;
    },
    sigismember: function(set, signum) 
    {
        return HEAP32[((set)>>2)] & (1 << (signum-1));
    },
    sigaction: function(signum, act, oldact) 
    {
    //int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact);
    #if ASSERTIONS
        signal__deps.printErr('Calling stub instead of sigaction()');
    #endif
        return 0;
    },
    sigprocmask: function() 
    {
    signal__deps.printErr('Calling stub instead of sigprocmask()');
        return 0;
    },
    __libc_current_sigrtmin: function() 
    {
    signal__deps.printErr('Calling stub instead of __libc_current_sigrtmin');
        return 0;
    },
    __libc_current_sigrtmax: function() 
    {
    signal__deps.printErr('Calling stub instead of __libc_current_sigrtmax');
        return 0;
    },
    kill__deps: ['$ERRNO_CODES', '__setErrNo'],
    kill: function(pid, sig) 
    {
    // http://pubs.opengroup.org/onlinepubs/000095399/functions/kill.html
    // Makes no sense in a single-process environment.
      // Should kill itself somtimes depending on `pid`
    signal__deps.printErr('Calling stub instead of kill()');
        ___setErrNo(ERRNO_CODES.EPERM);
        return -1;
    },
    killpg__deps: ['$ERRNO_CODES', '__setErrNo'],
    killpg: function() 
    {
    signal__deps.printErr('Calling stub instead of killpg()');
        ___setErrNo(ERRNO_CODES.EPERM);
        return -1;
    },
  siginterrupt: function() {
    signal__deps.printErr('Calling stub instead of siginterrupt()');
        return 0;
    },
    raise: function(sig) 
    {
        var ff = signal__deps['_sig_handler_'][sig] ;
        if ( typeof signal__deps['_sig_handler_'][sig] === 'undefined' )
          return -1;

        Runtime.dynCall('vi', ff, [0]);
        ___setErrNo(ERRNO_CODES.ENOSYS);

        return sig;
    },
    // http://pubs.opengroup.org/onlinepubs/000095399/functions/alarm.html
    alarm__deps: ['_sigalrm_handler'],
    alarm: function(seconds) 
    {
        setTimeout(function() {
          if (__sigalrm_handler) Runtime.dynCall('vi', __sigalrm_handler, [0]);
        }, seconds*1000);
    },
    ualarm: function() 
    {
        throw 'ualarm() is not implemented yet';
    },
    setitimer: function() 
    {
        throw 'setitimer() is not implemented yet';
    },
    getitimer: function() 
    {
        throw 'getitimer() is not implemented yet';
    },
    pause__deps: ['__setErrNo', '$ERRNO_CODES'],
    pause: function() 
    {
        // int pause(void);
        // http://pubs.opengroup.org/onlinepubs/000095399/functions/pause.html
        // We don't support signals, so we return immediately.
    signal__deps.printErr('Calling stub instead of pause()');
        ___setErrNo(ERRNO_CODES.EINTR);
        return -1;
  },
    sigpending: function(set) 
    {
        HEAP32[((set)>>2)]=0;
        return 0;
    }
  //signalfd
  //ppoll
  //epoll_pwait
  //pselect
  //sigvec
  //sigmask
  //sigblock
  //sigsetmask
  //siggetmask
  //sigsuspend
  //bsd_signal
  //siginterrupt
  //sigqueue
  //sysv_signal
  //signal
  //pthread_kill
  //gsignal
  //ssignal
  //psignal
  //psiginfo
  //sigpause
  //sigisemptyset
  //sigtimedwait
  //sigwaitinfo
  //sigreturn
  //sigstack
  //sigaltstack(2)
  //sigsetops(3),
  //sighold
  //sigrelse
  //sigignore
  //sigset
};

mergeInto(LibraryManager.library, funs);

Internal compiler error in src/compiler.js! Please raise a bug report at https://github.com/kripken/emscripten/issues/ with a log of the build and the input files used to run. Exception message: "SyntaxError: Unexpected token ILLEGAL" | SyntaxError: Unexpected token ILLEGAL
at Object.LibraryManager.load (eval at globalEval (C:\Program Files\Emscripten\emscripten\1.35.0\src\compiler.js:105:8), :146:14)
at JSify (eval at globalEval (C:\Program Files\Emscripten\emscripten\1.35.0\src\compiler.js:105:8), :61:20)
at Object. (C:\Program Files\Emscripten\emscripten\1.35.0\src\compiler.js:208:3)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:475:10)
at startup (node.js:117:18)
at node.js:951:3
Traceback (most recent call last):
File "C:\Program Files\Emscripten\emscripten\1.35.0\emcc", line 1344, in
final = shared.Building.emscripten(final, append_ext=False, extra_args=extra_args)
File "C:\Program Files\Emscripten\emscripten\1.35.0\tools\shared.py", line 1571, in emscripten
call_emscripten(cmdline)
File "C:\Program Files\Emscripten\emscripten\1.35.0\emscripten.py", line 1304, in _main
temp_files.run_and_clean(lambda: main(
File "C:\Program Files\Emscripten\emscripten\1.35.0\tools\tempfiles.py", line 64, in run_and_clean
return func()
File "C:\Program Files\Emscripten\emscripten\1.35.0\emscripten.py", line 1310, in
DEBUG_CACHE=DEBUG_CACHE,
File "C:\Program Files\Emscripten\emscripten\1.35.0\emscripten.py", line 1208, in main
temp_files=temp_files, DEBUG=DEBUG, DEBUG_CACHE=DEBUG_CACHE)
File "C:\Program Files\Emscripten\emscripten\1.35.0\emscripten.py", line 201, in emscript
cwd=path_from_root('src'), error_limit=300)
File "C:\Program Files\Emscripten\emscripten\1.35.0\tools\jsrun.py", line 75, in run_js
raise Exception('Expected the command ' + str(command) + ' to finish with return code ' + str(assert_returncode) + ', but it returned with code ' + str(proc.returncode) + ' instead! Output: ' + str(ret)[:error_limit])
Exception: Expected the command ['C:/Program Files/Emscripten/node/4.1.1_64bit/bin/node', 'C:\Program Files\Emscripten\emscripten\1.35.0\src\compiler.js', 'c:\users\claudio\appdata\local\temp\tmpjios4y.txt', 'C:\Program Files\Emscripten\emscripten\1.35.0\src\library_pthread_stub.js'] to finish with return code 0, but it returned with code 1 instead! Output: // The Module object: Our interface to the outside world. We import
// and export values on it, and do the work to get that through
// closure compiler if necessary. There are various ways Module can be used:
// 1. Not defined. We create it here
// 2. A function parameter, function(Module) { ..gener

@kripken
Copy link
Member

kripken commented Nov 23, 2015

I can't reproduce this. I put some tabs into src/library.js and I don't see an error.

@ghost
Copy link
Author

ghost commented Nov 23, 2015

let me do others tests

@stale
Copy link

stale bot commented Jun 4, 2021

This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.

@stale stale bot added the wontfix label Jun 4, 2021
@stale stale bot closed this as completed Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant