Menu

#274 Instantiating object within class definition crashes

4.0*
closed-fixed
None
5
2015-12-10
2015-12-05
No

Demo script:

package require Itcl

itcl::class C {C #auto}

This crashes after displaying the following:

before Itcl_RegisterObjectVariable hPtr2 == NULL!

Discussion

  • Don Porter

    Don Porter - 2015-12-08

    This is not a recent regression. Any guidance on what the right behavior ought to be?

    (Yes, yes, I know it starts with "don't crash")

     
  • Don Porter

    Don Porter - 2015-12-10

    Well, this is a weird thing to do, I think. The demo script is creating a command [::itcl::parser::c0]. Hard to imagine that's ever the intent.

    That said, it works in Itcl 3, and if we just revise the panic to a more forgiving reaction, it can work in Itcl 4 too it seems

     
  • Don Porter

    Don Porter - 2015-12-10

    Ok, check this out:

    % package require Itcl
    3.4
    % itcl::class C { C ::x }
    % itcl::delete object x
    make: *** [shell] Segmentation fault
    
     
  • Don Porter

    Don Porter - 2015-12-10

    Fixed the problem with Itcl 3.

    Then replaced the panic with acceptance.

    Will have to see what new bugs this exposes.

     
  • Don Porter

    Don Porter - 2015-12-10
    • status: open --> closed-fixed
    • assigned_to: Don Porter
     

Log in to post a comment.