https://bugs.kde.org/show_bug.cgi?id=488885

            Bug ID: 488885
           Summary: Assertion in ExpressionVisitor::visitListComprehension
                    when parsing complex expression
    Classification: Developer tools
           Product: kdev-python
           Version: unspecified
          Platform: Neon
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Language support
          Assignee: m...@svenbrauch.de
          Reporter: frmdst...@protonmail.com
  Target Milestone: ---

SUMMARY

I kept seeing a crash and traced it down to when kdevelop parses the file at
https://github.com/horizon-eda/horizon/blob/master/scripts/pybis.py . It hits
the assertion at
https://invent.kde.org/kdevelop/kdev-python/-/blob/master/duchain/expressionvisitor.cpp?ref_type=heads#L478
 

STEPS TO REPRODUCE

The failing comprehension code is at
https://github.com/horizon-eda/horizon/blob/master/scripts/pybis.py#L1672-L1676.
I copied it here:

```
        stub_desc = (
            stubKeyword('Len') +"
            Each([ Optional(stubKeyword(k)) for k in [ 'L', 'R', 'C' ] ]) -
            Suppress(Literal('/') + LineEnd() * (0,)) 
        ).setParseAction(lambda f: IBISNode(f.asDict()))
```

OBSERVED RESULT

The assertion that the context is found fails.

EXPECTED RESULT

It should probably just ignore determining the list type when no context is
found? Wrapping that code in an `if(comprehensionContext) {` avoids the
problem.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  6.0
KDE Plasma Version:  6.0.5
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.0

ADDITIONAL INFORMATION

I'm using the KF6 branches for KDevelop and the kdev-python but that should not
matter.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to