Tcl Source Code

View Ticket
Login
Ticket UUID: fc1409fc9193f33f39f7e6ea353364a9a4b8048c
Title: TclOO method with non-literal value for body argument causes segmentation fault
Type: Bug Version:
Submitter: pooryorick Created on: 2017-10-19 21:26:13
Subsystem: 35. TclOO Package Assigned To: dkf
Priority: 9 Immediate Severity: Important
Status: Closed Last Modified: 2017-10-24 14:11:55
Resolution: Fixed Closed By: dkf
    Closed on: 2017-10-24 14:11:55
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: dkf added on 2017-10-24 11:16:34:
Needs that code worked into a test. I'll sort it.

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