Skip to content

[Branch: openmath] Crash with array and \mathxx and malformed brackets #160

@jokteur

Description

@jokteur

Hi,

When having this example code,

\begin{array}{l}
  \mathbf{
\end{array}

or

\begin{array}{l}
  \mathit{
\end{array}

or whatever \mathxx{, microtex on the openbranch makes a segmentation fault.
In particular, in atom_font.cpp, my debugger says that:

sptr<Box> FontStyleAtom::createBox(Env& env) {
  if (_nested) {
    _mathMode ? env.addMathFontStyle(_style) : env.addTextFontStyle(_style);
    auto box = _atom->createBox(env);
    _mathMode ? env.removeMathFontStyle(_style) : env.removeTextFontStyle(_style);
    return box;
  }
  return env.withFontStyle(_style, _mathMode, [&](Env& e) { return _atom->createBox(e); }); // _atom is nullptr
}

_atom is nullptr. This happens will all fonts, XITS, Latin Modern, Fira and Gyre DejaVu. This really only happens in array mode, and this bug doesn't happen in the master branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions