Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
apnadkarni opened this issue Oct 25, 2024 · 3 comments

Comments

@apnadkarni
Copy link
Contributor

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.

@apnadkarni
Copy link
Contributor Author

As a workaround, calling cproc within a proc using tailcall works.

apnadkarni added a commit to apnadkarni/tarray that referenced this issue Oct 25, 2024
@andreas-kupries
Copy link
Owner

Is it possible to bisect the place where the issue turns up ?

@apnadkarni
Copy link
Contributor Author

Don’t have the time to look into it further right now. Travel coming up in Nov and I need to finish a bunch of updates for my extensions before then. Not a priority as there is a workaround.

/Ashok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants