Skip to content
Commit 9acd3b84 authored by Oliver Kellogg's avatar Oliver Kellogg
Browse files

Fix crash importing Pascal code via import wizard:

umbrello/umldoc.{h,cpp}
- New function findDatatype(QString name, bool includeInactive) seeks
  the given name in the Datatypes folder and returns pointer to the
  UMLDatatype object if found, otherwise nullptr.
- In function createDatatype return pointer to the UMLDatatype created.

umbrello/codeimport/pascalimport.h
- Prepare for reimplementing NativeImportBase function `split'.

umbrello/codeimport/pascalimport.cpp
- Add TODO note at function split(const QString&).
- In function parseStmt :
  - Log a debug message showing the token currently being parsed along
    with its m_srcIndex and following token.
  - Add preliminary handling of "[".
  - On handling "function", "procedure", "constructor", "destructor",
    if m_klass is null then call skipStmt() before returning.
  - At start of handling m_section sect_TYPE, if m_klass is null then
    save return value from advance() to local QString rhsName for
    preserving the casing (which is lost in `keyword').
  - Provide first implementation for handling datatypes.
  - On handling "At this point we need a class [...]" near end of
    function,
    - handle nullptr returned by Import_Utils::insertAttribute as a
      regular error and avoid dereferencing it;
    - handle nullptr returned by o->asUMLAttribute() as a regular error
      and avoid dereferencing it.
    This hunk is the actual crash fix.

BUG: 449129
FIXED-IN:2.33.80 (KDE releases 22.03.80)
parent 9179dcd2
Pipeline #130980 passed with stage
in 14 minutes and 34 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment