Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2017-10-24
14:11 • Closed ticket [fc1409fc91]: TclOO method with non-literal value for body argume... artifact: 17c274f587 user: dkf
14:11
Cherrypick: [fc1409fc91] Method cloning needs to be careful with body representations. check-in: 0aa4803add user: dkf tags: core-8-6-branch
11:25
[fc1409fc91] Method cloning needs to be careful with body representations. check-in: 0d7a96d2b5 user: dkf tags: trunk
11:16 • Open ticket [fc1409fc91]: TclOO method with non-literal value for body argument... artifact: 9f0b45949a user: dkf
08:47 • Closed ticket [fc1409fc91]. artifact: 7761315ff6 user: pooryorick
08:38
[fc1409fc91]: TclOO method with non-literal value for body argument causes segmentation fault check-in: d6d4b18fc1 user: pooryorick tags: bug-fc1409fc91
2017-10-19
21:26 • New ticket [fc1409fc91] TclOO method with non-literal value for body argument c... artifact: 532ca439bb user: pooryorick

TclOO method with non-literal value for body argument causes segmentation fault

Closed / Fixedfc1409fc9193f33f39f7e6ea353364a9a4b8048cCreated 9 years agoUpdated 9 years ago
Descriptionwiki2017-10-19 21:26:13
The following script causes a segmentation fault:

::oo::objdefine oo::object {
	method m1 {} [string map {a b} hello] 
}

oo::copy oo::object obj1
obj1 m1 

This is a regression cause by the fix to bug 3609693. In TclOOMethod.c/CloneProcedureMethod, TclFreeIntRep(bodyObj) occurs on a Tcl_Obj that has no string representation. The solutions is to call Tcl_GetString(bodyObj) first.

Referenced by3
  • 0aa4803addCherrypick: [fc1409fc91] Method cloning needs to be careful with body representations. check-in2017-10-24 14:11:16
  • 0d7a96d2b5[fc1409fc91] Method cloning needs to be careful with body representations. check-in2017-10-24 11:25:29
  • d6d4b18fc1[fc1409fc91]: TclOO method with non-literal value for body argument causes segmentation fault check-in2017-10-24 08:38:17
pooryorickplain2017-10-24 08:47:01
Fixed in commit d6d4b18fc1.
dkfplain2017-10-24 11:16:34
Needs that code worked into a test. I'll sort it.
dkf Closed ticket [fc1409fc91]. [History diff]2017-10-24 14:11:55
Log in (anonymous is fine) to add a comment.