Skip to content
Tcl Source Code View Ticket
Login

View Ticket

tclInterp.c: Tcl_Free() called through pointer of incorrect type

Closed / Fixed52dbc4b3f8ef52c40eb8dd2080c5de48a14cd49cCreated 3 years agoUpdated 3 years ago
Descriptionwiki2023-10-13 08:35:33
Tcl_Free() is not a Tcl_LimitHandlerDeleteProc. Nothing in core Tcl calls Tcl_LimitAddHandler() with TCL_DYNAMIC as the deleteProc, but I predict that doing so would cause UBSan -fsanitize=function errors with the following:
runtime error: call to function TclpFree through pointer to incorrect function type 'void (*)(void *)'

A workaround would be to use a wrapper function; see attached patch.

Referenced by2
chrstphrchvzwiki2023-10-17 09:53:47

This was fixed in [e75f319dc8cf]. Thanks, Jan!

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

Attachments: