Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

WAD TCC Crash

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
 
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".
 
Thanks. That fixes it, though TCC generating an unhandled exception probably isn't good.
TCC usually catches nesting that's too deep without crashing. Maybe Rex will look into your example.
Code:
v:\> type callme.btm
call %0
quit

:foo
echo bar

v:\> callme.btm
TCC: V:\callme.btm [1]  Exceeded batch nesting limit
 
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.)
 

Similar threads

Back
Top