diff options
author | apnadkarni <apnmbx-wits@yahoo.com> | 2024-05-08 13:30:42 (GMT) |
---|---|---|
committer | apnadkarni <apnmbx-wits@yahoo.com> | 2024-05-08 13:30:42 (GMT) |
commit | 5152772a4fa841253deb7061bd17f3c16f26365c (patch) | |
tree | 2730964079826c792b6e1f7a79f2e302c5465c47 | |
parent | b7e3bc9141d8942f339f6522115f3580ae1ab41c (diff) | |
download | tcl-5152772a4fa841253deb7061bd17f3c16f26365c.zip tcl-5152772a4fa841253deb7061bd17f3c16f26365c.tar.gz tcl-5152772a4fa841253deb7061bd17f3c16f26365c.tar.bz2 |
Start on at least protecting against crashes like [0de6c1d79c]
-rw-r--r-- | generic/tclCmdIL.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index c46ab60..52bde71 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -1144,6 +1144,29 @@ InfoFrameCmd( return TCL_ERROR; } + if (iPtr->cmdFramePtr == NULL) { + if (objc == 1) { + Tcl_SetObjResult(interp, Tcl_NewIntObj(1)); + } else { + if (TclGetIntFromObj(interp, objv[1], &level) != TCL_OK) { + code = TCL_ERROR; + } else { + Tcl_Obj *objs[2]; + /* + * TODO - "precompiled" is a lie. Chosen only because as documented + * no other fields in the dictionary need be returned. Should + * add a new type like "unknown" meaning no further information + * available. + * TODO - should we check that "level" is 1 ? + */ + TclNewLiteralStringObj(objs[0], "type"); + TclNewLiteralStringObj(objs[1], "precompiled"); + Tcl_SetObjResult(interp, Tcl_NewListObj(2, objs)); + } + } + return code; + } + while (corPtr) { while (*cmdFramePtrPtr) { topLevel++; |