Skip to content

Regression after critcl 3.1.15 in calling cproc within a proc or eval body #132

Description

@apnadkarni

The following snippet which used to work in critcl 3.1.15 generates an error in critcl 3.3.1.

set TEMPLATE {
    critcl::cproc xx {Tcl_Interp* interp Tcl_Obj* oa Tcl_Obj* ob} ok {
        return TCL_OK;
    }
}
eval $TEMPLATE

The error is

No location to change
    while executing
"at::incrt $name"
    (procedure "critcl::cproc" line 66)
    invoked from within
"critcl::cproc xx {Tcl_Interp* interp Tcl_Obj* oa Tcl_Obj* ob} ok {
        return TCL_OK;
    }"
    ("eval" body line 2)
    invoked from within
"eval $TEMPLATE"

Directly calling cproc (instead of via eval) as follows works

critcl::cproc xx {Tcl_Interp* interp Tcl_Obj* oa Tcl_Obj* ob} ok {
    return TCL_OK;
}

This is of course a stripped down sample. In my original use case, which worked with crticl 3.1.15, the eval was actually a function that was called repeatedly to generate templatized cproc definitions to save me some tedious typing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions