Skip to content
Tcl Source Code View Ticket
Login

View Ticket

[namespace upvar] problem in TclOO constructor

Closed / Fixede6d86e4a92faff0dfc070ab48817da9e2b71092fCreated 9 years agoUpdated 9 years ago
Descriptionwiki2017-08-07 18:19:41
The selenium-tcl package uses [namespace upvar] in the ErrorHandler constructor to propagate error messages and the like to individual objects. Using ActiveTcl 8.6.1, this works fine on Windows, but causes a SegFault on Ubuntu Linux 12.04.

The code below illustrates the problem:

namespace eval ns {
    array set arr {
	1 one
	2 two
	3 three
    }
}

oo::class create noddy {
    variable m_arr

    constructor {} {
	namespace upvar ::ns arr [self namespace]::m_arr
    }
}

noddy create n
sebreswiki2017-08-08 12:32:30

Not reproduceable on current 8.6 / trunk.
And upvar reference between the member variable to namespace array was also set correctly.


% oo::define noddy method get_arr {} {array get m_arr}
% ::n get_arr
1 one 2 two 3 three
% set ::ns::arr(0) zero
zero
% ::n get_arr
0 zero 1 one 2 two 3 three

Seems to be already fixed (I remember similar issue as regards variable resolver on some previous 8.6th version long time ago).
Please test the newest 8.6 version.

Log in (anonymous is fine) to add a comment.