| 1798 | // |
| 1799 | |
| 1800 | static act* par_end_for() |
| 1801 | { |
| 1802 | if (!cur_for) |
| 1803 | PAR_error("unmatched END_FOR"); |
| 1804 | |
| 1805 | act* begin_action = (act*) MSC_pop(&cur_for); |
| 1806 | if (!begin_action) |
| 1807 | return NULL; |
| 1808 | |
| 1809 | PAR_end(); |
| 1810 | gpre_req* request = begin_action->act_request; |
| 1811 | |
| 1812 | // If the action is a blob for, make up a blob end. |
| 1813 | |
| 1814 | if (begin_action->act_type == ACT_blob_for) |
| 1815 | { |
| 1816 | blb* blob = (blb*) begin_action->act_object; |
| 1817 | act* action = MSC_action(request, ACT_endblob); |
| 1818 | action->act_object = (ref*) blob; |
| 1819 | begin_action->act_pair = action; |
| 1820 | action->act_pair = begin_action; |
| 1821 | HSH_remove(blob->blb_symbol); |
| 1822 | blob->blb_flags |= BLB_symbol_released; |
| 1823 | return action; |
| 1824 | } |
| 1825 | |
| 1826 | // If there isn't a database assigned, the FOR statement itself |
| 1827 | // failed. Since an error has been given, just return quietly. |
| 1828 | |
| 1829 | if (!request->req_database) |
| 1830 | return NULL; |
| 1831 | |
| 1832 | act* action = MSC_action(request, ACT_endfor); |
| 1833 | begin_action->act_pair = action; |
| 1834 | action->act_pair = begin_action; |
| 1835 | EXP_rse_cleanup(request->req_rse); |
| 1836 | |
| 1837 | for (blb* blob = request->req_blobs; blob; blob = blob->blb_next) |
| 1838 | { |
| 1839 | if (!(blob->blb_flags & BLB_symbol_released)) |
| 1840 | HSH_remove(blob->blb_symbol); |
| 1841 | } |
| 1842 | |
| 1843 | return action; |
| 1844 | } |
| 1845 | |
| 1846 | |
| 1847 | //____________________________________________________________ |
no test coverage detected