Tcl Source Code

View Ticket
Login
Ticket UUID: cb03e57a7b24d22c071acc1b00bc1d91649d1d79
Title: Non-existent variables are ignored if re is {}
Type: Bug Created on: 2020-10-21 02:19:14
Submitter: stu Assigned to: jan.nijtmans
Subsystem: 43. Regexp Severity: Important
Priority: 5 Medium Last modified: 2025-11-11 19:52:09
Status: Closed Closed by: jan.nijtmans
Resolution: Fixed Closed on: 2025-11-11 19:52:09
Version:
Description:
"This should not be!"

% unset -nocomplain q
% regexp {.} $q
can't read "q": no such variable
% regexp {} $q
1
User Comments:
stu (claiming to be Stu) added on 2025-11-08 02:19:14:
Same result with 9.0.3rc0.

emiliano on chat pointed out that this yields the same result as well:

% regexp {} [set q]
1

apnadkarni added on 2025-11-08 06:45:43:
% set regexp regexp
regexp
% $regexp {} $q
can't read "q": no such variable

So looks like an issue with the byte compiled form.


apnadkarni added on 2025-11-08 07:43:11:

Proposed fix in branch bug-cb03e57a.


jan.nijtmans added on 2025-11-08 23:23:31:

+1. Let's fix this for 9.0.3


jan.nijtmans added on 2025-11-11 19:52:09:

Fixed [58edb3342051de34|here]