Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2014-11-24
03:09 • Closed ticket [e078712465]: operatorStrings missing an empty string plus 6 o... artifact: 08329acb70 user: dgp
2014-11-22
22:47 • Ticket [e078712465]: 3 changes artifact: 64dc66aee9 user: ferrieux
19:06 • Ticket [e078712465]: 3 changes artifact: 164b589341 user: dgp
2014-11-21
21:27 • New ticket [e078712465]. artifact: ff92d494f5 user: dgp

operatorStrings missing an empty string

Closed / Fixede0787124655e40ae2d1d4052911fcc1d21dfb20eCreated 12 years agoUpdated 12 years ago
Descriptionplain2014-11-21 21:27:59
The array "operatorStrings" in tclExecute.c is commented to need
matching up with the opcode lists in tclCompile.h.  It doesn't
match.  It's missing an empty string.  There are 8 empty strings
between "FUNCTION" and "eq" and there need to be 9.

Coverity apparently detected (1251249?) there was something wrong, and declared
it a off by one.  See the commit

http://core.tcl.tk/tcl/info/12524da9f5

where an attempt to fix was committed.  It's the wrong fix though.
The true error is in the data, not in the code.

A good test in the test suite followed by the proper fix is
the right way forward.
dgpplain2014-11-22 19:06:39
The true fix is even easier.  There's no need
for operatorStrings to extend beyond INST_LNOT.
Patch coming soon.
ferrieuxplain2014-11-22 22:47:14
It would seem cleaner to allocate an full array of size LAST_INST_OPCODE, initialized by a macro-repetitive function, instead of relying on specific ranges of opcodes to belong to specific semantic families (which is not the case; opcode simply grow monotonically over time).
dgpplain2014-11-24 03:09:25
"Fix the hack" applied to active branches.

Agree that a more appealing longer term fix
would be "merge the hacks" or even re-work so
that needed functionality is present without hacks.
Not today.
Log in (anonymous is fine) to add a comment.