#261 Tcl: NULL bug fix and hash table method lookup


This patch addresses two issues:
1. Currently if a wrapped function returns a NULL value, a "NULL" command will be created in the Tcl interpreter. Calling this command will cause a segmentation fault. A very small part of this patch makes a change to not create the "NULL" command when returning a NULL object value.

2. The current implementation searches for class methods using a linear search. This can cause performance issues in wrappers for classes with many member functions. This patch adds a method hash table to classes and changes method name lookup to use the hash table instead of doing a linear search.

I've also added a Tcl run-time test for null_pointer to check for the unwanted "NULL" command.


  • William Fulton

    William Fulton - 2011-03-29
    • assigned_to: nobody --> wsfulton
    • status: open --> closed-accepted
  • William Fulton

    William Fulton - 2011-03-29

    We doo't have a TCL maintainer at the moment, but the patch adds a test and the test-suite still passes, so I have committed it to svn for swig-2.0.3. Thanks!


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks