Memory access violation in scripts > 2**31 bytes
Having a script longer than INT_MAX results in memory access violations even on 64-bit builds. Example is below (invalid set command is intentional)
try [string cat [string repeat " " 0x80000000] "set a b c"]
This is just one example but between the byte code compiler and TIP 280 source code -> source line number tracking there are many occasions for overflowing length limits. Fixing these is non trivial and risky so for the moment the plan is to disallow scripts or byte code sequences longer than INT_MAX.
Marking as minor since not likely to have a such a long script. Scripts in safe interps are still a concern however so protection is still desirable.
15b917781dNew ticket [03cff7a777] -Wconversion warnings, like TclAdvanceContinuations(). ticket2025-04-16 08:48:155285a51808Remove protections and open branch to work on [27b3ce2997]. check-in2025-02-27 18:39:1120ed83cf25Fix [27b3ce2997] - check INT_MAX limit on script length check-in2023-04-30 10:20:19
Fixed in [20ed83cf25]. Generates a Tcl exception now instead of panics or crashes. Allowing for longer scripts is a longer term exercise, 9.1 or may be even later.
Just taking notice of this. The limit doesn't merge to dgp-refactor, and not yet clear if the revisions there are a means of eliminating it.
Quick answer is no, that branch crashes too without protection.
Claiming and re-opening with some interest in examining what might be done in 9.1