You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
det translator: a NOT ON SIZE ERROR after a nested unterminated arithmetic statement binds to the outer one #4676
A conditional arithmetic statement nested in another's ON SIZE ERROR phrase, without its own END- terminator, takes the following NOT ON SIZE ERROR phrase in COBOL (the phrase belongs to the innermost unterminated statement). GnuCOBOL does that; the det translator gives the phrase to the outer statement, so the port runs different statements.
Repro (measured 2026-10-07, GnuCOBOL 3.1.2 -std=ibm; A = 1, B = 3, C = 300, Z0 = 0, R = 12.34, R2 = 1):
COMPUTE R = A / Z0
ONSIZEERRORCOMPUTE R2 = A / B * C
NOTONSIZEERRORCOMPUTE R2 = A / B *7END-COMPUTEDISPLAY'B1 ' R '' R2
...more statements, no period
Oracle: B1 01234 00233 and nothing after it (the NOT phrase belongs to the inner COMPUTE; END-COMPUTE closes the innermost COMPUTE, so the rest of the sentence sits inside the outer ON SIZE ERROR). Det port: B1 01234 09900, and it runs the statements after it.
With each nested statement terminated (ON SIZE ERROR COMPUTE ... END-COMPUTE NOT ON SIZE ERROR COMPUTE ... END-COMPUTE END-COMPUTE) both sides agree (pinned by #4655's test_det_size_error.py, B1).
Proposal
In det/stmt.py's scope rules, attach a conditional phrase (ON SIZE ERROR / NOT ON SIZE ERROR, AT END, INVALID KEY, ON OVERFLOW ...) to the innermost unterminated statement that can take it, and pair an END- terminator with the innermost open statement of its verb. Probably rare in real estates (code style terminates nested statements); a test from this repro either way.
Activity
det: a float zero divisor is libcob's NaN; a phrase binds to the inne…
port_blockers: 16 closed det/harness blockers from #4523-#4676 (Part of