ccrma / chuck

ChucK Music Programming Language
http://chuck.stanford.edu/
GNU General Public License v2.0
803 stars 128 forks source link

trailing single-line comment causes a crash #366

Closed gewang closed 1 year ago

gewang commented 1 year ago
<<< 1 >>>; // 
cchafe commented 1 year ago

Not here. (quick test inserting this in a rather complex .ck file) Running chuck version: 1.5.0.4 (chai)

nshaheed commented 1 year ago

chris, are you running on linux? I just tried ge's example from HEAD on ubuntu and it didn't crash either

cchafe commented 1 year ago

fedora 38

nshaheed commented 1 year ago

Just tried HEAD on windows and it works fine, seems like it's a mac-only error?

gewang commented 1 year ago

for me it crashes miniAudicle (macOS) but not CLI chuck on the same computer...

gewang commented 1 year ago

more info: it seems to crash consistently for me on linux and mac, miniAudicle and CLI chuck if the code is not read from file, but compiled from a string, e.g., run from Machine.eval()

// this seems to crash more reliably
Machine.eval( "<<< 1 >>>; // " );
gewang commented 1 year ago

verified: crashing when the code was parsed by ck compiler using flex/bison through yy_scan_string() -- e.g., if code originates from Machine.eval() or from a code buffer in miniAudicle or WebChucK IDE

issue appears related to the comment_hack (lol) macro in chuck.lex; we have now moved to a different way of handling single-line comments (3528619)