Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-9185

rootcling dereferences null pointer

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 6.12/04
    • Fix Version/s: 6.14/00, 6.16/00
    • Component/s: Dictionaries
    • Labels:
      None
    • Environment:

      Linux/All

      Description

      $ cat a.h

      template <typename T>
      struct Traits {
          static const int isStatic = 1;
      };
       
      template <int I>
      struct InnerBase {};
       
      template <typename T>
      class Outer {
      public:
          struct Inner : InnerBase<Traits<T>::isStatic> {};
      };

      $ cat linkdef.h

      #pragma link C++ defined_in a.h;

      Goes >plink< in ROOT::TMetaUtils::WriteClassInit, b/c this:

      iter->getType()->getAsCXXRecordDecl()

      in TClingUtils.cxx returns a null pointer when running:

      rootcling -f a.cxx a.h linkdef.h

      The obvious workaround seems a nullptr check, and a continue if no CXXRecordDecl: the base has no meaning until instantiation.

      However, then CloseStreamerInfoROOTFile gets antsy:

      Error in <CloseStreamerInfoROOTFile>: Cannot find class Outer<T>::Inner.

      so the scanner should probably ignore it already in fSelectedClasses.

        Attachments

          Activity

            People

            Assignee:
            axel Axel Naumann
            Reporter:
            wlav Wim Lavrijsen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: