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

wegamekinglc / Derivatives-Algorithms-Lib / 28700622085

04 Jul 2026 08:31AM UTC coverage: 82.244% (+0.2%) from 81.996%
28700622085

Pull #204

github

wegamekinglc
Fix IfElse bStack underflow in compiled evaluator

EvalCompiled reset the thread_local bStack on every entry, including the
recursive call the IfElse case made to evaluate the true branch. That
re-entry wiped the parent frame's bStack (where the just-tested condition
still sat), so the parent's subsequent bStack.Pop() underflowed sp_ from
-1 to -2 and a later Push wrote data_[-1] into the call frame's locals.
Every IfElse whose condition was true triggered it; Phase 0's UBSAN run
confirmed the diagnostic (stacks.hpp:133,135 'index -1 out of bounds for
type bool [128]').

Split the entry from the loop: EvalCompiledRange(first, last) runs the
opcode switch without the Reset() prologue, so the IfElse true branch
dispatches through it and preserves the parent's stacks. The per-event
EvalCompiled entry keeps the Reset() and delegates to the range helper
over the full stream. The stacks are shared via CompiledDStack<T_>() /
CompiledBStack() accessors so both functions operate on the same
thread-local instance.

Enabled the two Phase-0 IfElse parity pins
(TestParity_IfElse_ConsecutiveBothTrue, TestParity_IfElse_NestedInTrueBranch)
which go from UBSAN-crash to GREEN. The nested case exercises the
re-entrancy the range helper must support.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Pull Request #204: fix: IfElse bStack underflow in compiled evaluator

0 of 1 new or added line in 1 file covered. (0.0%)

37 existing lines in 1 file now uncovered.

6429 of 7817 relevant lines covered (82.24%)

3318617.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

49.45
/dal-cpp/dal/script/visitor/compiler.hpp


Source Not Available

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