Tcl Source Code

View Ticket
Login
Ticket UUID: 2923d52832931c60b2163b2e4b09c828d710a2f0
Title: INST_STR_MATCH != TclStringMatchObj()
Type: Bug Created on: 2016-03-30 16:05:15
Submitter: dgp Assigned to: nobody
Subsystem: 10. Objects Severity: Minor
Priority: 5 Medium Last modified: 2016-03-30 16:20:08
Status: Open Closed by: nobody
Resolution: None Closed on:
Version: trunk
Description:
In tclExecute.c, the implementation of the
INST_STR_MATCH instruction pretty apparently
wants to be the same function as the internal
routine TclStringMatchObj().

However, the code is not the same.  It appears
the tclExecute.c code is correct, since the
TclStringMatchObj() routine in tclUtil.c is written
so that a whole stanza is unreachable.

This feels so wrong to have this code duplication.
Is it truly unacceptable in some way to just have
tclExecute.c call TclStringMatchObj() when it 
needs it?  If so, might we at least use a common
macro expansion in both places?

See also 
http://core.tcl.tk/tcl/tktview?name=85b87a7570
User Comments:
dgp added on 2016-03-30 16:20:08:
ok, I misread it.  The stanza is not unreachable.

The two code sections do implement different
logic though, and I cannot see why they ought
not be the same -- and in fact be the same
chunk of code.