Tcl Source Code

View Ticket
Login
Ticket UUID: fc1409fc9193f33f39f7e6ea353364a9a4b8048c
Title: TclOO method with non-literal value for body argument causes segmentation fault
Type: Bug Created on: 2017-10-19 21:26:13
Submitter: pooryorick Assigned to: dkf
Subsystem: 35. TclOO Package Severity: Important
Priority: 9 Immediate Last modified: 2017-10-24 14:11:55
Status: Closed Closed by: dkf
Resolution: Fixed Closed on: 2017-10-24 14:11:55
Version:
Description:

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.

User Comments:
pooryorick added on 2017-10-24 08:47:01:
Fixed in commit d6d4b18fc1.

dkf added on 2017-10-24 11:16:34:
Needs that code worked into a test. I'll sort it.