chooseRegs: an end with no begin before it no longer indexes before the stack (found by the fuzz on a new test)
| @@ -2500,8 +2500,12 @@ | ||
| 2500 | 2500 | if isLoop[d] then INC(loops); end; |
| 2501 | 2501 | end; |
| 2502 | 2502 | | sEnd, sUntil: |
| 2503 | - if isLoop[d] then DEC(loops); end; | |
| 2504 | - DEC(d); | |
| 2503 | + (* an end with no begin before it, in a body the parser will | |
| 2504 | + report, leaves d at 0 *) | |
| 2505 | + if d > 0 then | |
| 2506 | + if isLoop[d] then DEC(loops); end; | |
| 2507 | + DEC(d); | |
| 2508 | + end; | |
| 2505 | 2509 | | sIdent: |
| 2506 | 2510 | if Scan.id = nameAdr then |
| 2507 | 2511 | Scan.next; |