• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / qiskit / 27433757677
88%

Build:
DEFAULT BRANCH: main
Ran 12 Jun 2026 06:32PM UTC
Jobs 1
Files 947
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 Jun 2026 05:40PM UTC coverage: 87.475% (-0.008%) from 87.483%
27433757677

push

github

web-flow
Fix stack-overflow segfault in OpenQASM 2 expression parsers (#16421)

* Fix stack-overflow segfault in OpenQASM 2 expression parsers

The current recursive implementation of the operator-precedence
expression parsers is susceptible to overflowing the stack on
excessively deep expressions.  The simplest way to trigger this is to
enter an arbitrary number of parentheses.

This patch puts a simple recursion-depth limit on the expression parser
to safely error out before it comes close to the stack depth.  We use
`sys.getrecursionlimit` on input simply as a compromise between not
wanting to define new keyword arguments in bugfix patches and still
wanting to allow some amount of control over the limit.

Future patches could consider replacing the recursive components of the
expression parser with iterative state-tracking parsing.  The outer
recursive-descent parser that handles the rest of the OpenQASM 2 grammar
has a bounded recursion depth by nature of the grammar it is parsing; it
is only the expression subparser that can reach arbitrary depths.

* Lower recursion limit

28 of 28 new or added lines in 5 files covered. (100.0%)

25 existing lines in 3 files now uncovered.

110770 of 126630 relevant lines covered (87.48%)

964843.82 hits per line

Coverage Regressions

Lines Coverage ∆ File
12
97.15
-0.48% crates/qasm2/src/parse.rs
10
73.9
-0.41% crates/circuit/src/parameter/symbol_expr.rs
3
92.54
1.29% crates/qasm2/src/lex.rs
Jobs
ID Job ID Ran Files Coverage
1 27433757677.1 12 Jun 2026 06:32PM UTC 947
87.48
GitHub Action Run
Source Files on build 27433757677
  • Tree
  • List 947
  • Changed 7
  • Source Changed 5
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #27433757677
  • 4d4c7a69 on github
  • Prev Build on gh-readonly-queue/main/pr-16228-3f269fe0c6a860dc871d08d780a7d3f059bc3e96 (#27417302793)
  • Next Build on main (#27442972175)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc