Itcl - the [incr Tcl] extension

Check-in [31b795fefd]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:small amend: simplifying code and cleanup in error
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | bug-1dc2d851eb
Files: files | file ages | folders
SHA3-256:31b795fefd95c725c44f1e06d9e4144d58707378610cb2b053a2270941ca0c51
User & Date: sebres 2019-02-08 22:38:48
Context
2019-02-08
23:08
2nd segfault-fix of [1dc2d851eb], cases "sfbug-254.2/-254.3" - no base/superclass without oo-machinery (if oo-subsystem is deleted, ::itcl::Root is not available anymore), tests passed now check-in: 11b92daedc user: sebres tags: bug-1dc2d851eb
22:38
small amend: simplifying code and cleanup in error check-in: 31b795fefd user: sebres tags: bug-1dc2d851eb
21:18
fix [1dc2d851eb] case "sfbug-254.1" - Tcl_GetObjectFromObj/Tcl_GetObjectAsClass could return NULL (without oo-machinery), test passed now check-in: bc31e1da48 user: sebres tags: bug-1dc2d851eb
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/itclBase.c.

341
342
343
344
345
346
347
348
349
350
351
352

353
354

355
356
357
358
359
360
361
362
363
364
#ifdef NEW_PROTO_RESOLVER
    ItclVarsAndCommandResolveInit(interp);
#endif

    objPtr = Tcl_NewStringObj("::oo::class", -1);
    Tcl_IncrRefCount(objPtr);
    clazzObjectPtr = Tcl_GetObjectFromObj(interp, objPtr);
    if (!clazzObjectPtr) {
        return TCL_ERROR;
    }
    tclCls = Tcl_GetObjectAsClass(clazzObjectPtr);
    if (!tclCls) {

        return TCL_ERROR;
    }

    root = Tcl_NewObjectInstance(interp, tclCls, "::itcl::Root",
	    NULL, 0, NULL, 0);
    Tcl_DecrRefCount(objPtr);

    Tcl_NewMethod(interp, Tcl_GetObjectAsClass(root),
	    Tcl_NewStringObj("unknown", -1), 0, &itclRootMethodType,
	    ItclUnknownGuts);
    Tcl_NewMethod(interp, Tcl_GetObjectAsClass(root),
	    Tcl_NewStringObj("ItclConstructBase", -1), 0,
	    &itclRootMethodType, ItclConstructGuts);







<
<
<
|
<
>


>


<







341
342
343
344
345
346
347



348

349
350
351
352
353
354

355
356
357
358
359
360
361
#ifdef NEW_PROTO_RESOLVER
    ItclVarsAndCommandResolveInit(interp);
#endif

    objPtr = Tcl_NewStringObj("::oo::class", -1);
    Tcl_IncrRefCount(objPtr);
    clazzObjectPtr = Tcl_GetObjectFromObj(interp, objPtr);



    if (!clazzObjectPtr || !(tclCls = Tcl_GetObjectAsClass(clazzObjectPtr))) {

	Tcl_DecrRefCount(objPtr);
        return TCL_ERROR;
    }
    Tcl_DecrRefCount(objPtr);
    root = Tcl_NewObjectInstance(interp, tclCls, "::itcl::Root",
	    NULL, 0, NULL, 0);


    Tcl_NewMethod(interp, Tcl_GetObjectAsClass(root),
	    Tcl_NewStringObj("unknown", -1), 0, &itclRootMethodType,
	    ItclUnknownGuts);
    Tcl_NewMethod(interp, Tcl_GetObjectAsClass(root),
	    Tcl_NewStringObj("ItclConstructBase", -1), 0,
	    &itclRootMethodType, ItclConstructGuts);