WAD TCC Crash

#1
TCC 15.00.26 x64 Windows 7 [Version 6.1.7601]

Rex, I've been using TCC/4NT for years. Love it. I found the following .bat file causes TCC to crash:

Code:
call :list %include%
goto :eof
 
:list
@FOR /F "tokens=1* delims=;" %%a IN ("%*") DO @if not {%%a}=={} @echo %%a&@call %0 %%b&goto :eof
goto :eof
 
#2
TCC and CMD handle IF's command differently. Fix it with parentheses:
Code:
(@echo %%a&@call %0 %%b&goto :eof)
Read about it in the help for IF, and read about the initialization directive "Duplicate CMD Bugs".
 

rconn

Administrator
Staff member
May 14, 2008
10,554
97
#5
Thanks. That fixes it, though TCC generating an unhandled exception probably isn't good.
It's difficult for TCC to detect infinite loops of that nature (calling multiple commands within a single command) without a lot of extra code, which slows everybody down for an exceedingly minor benefit. (I.e., running a bizarre CMD script that is relying on undocumented CMD behavior, without telling TCC you're running a bizarre CMD script.)