| 770 | } |
| 771 | |
| 772 | uint16_t Assembly::createFunction(uint8_t _args, uint8_t _rets, bool _nonReturning) |
| 773 | { |
| 774 | size_t functionID = m_codeSections.size(); |
| 775 | solRequire(functionID < 1024, AssemblyException, "Too many functions for EOF"); |
| 776 | solAssert(m_currentCodeSection == 0, "Functions need to be declared from the main block."); |
| 777 | solRequire(_rets <= 127, AssemblyException, "Too many function returns."); |
| 778 | solRequire(_args <= 127, AssemblyException, "Too many function inputs."); |
| 779 | m_codeSections.emplace_back(CodeSection{_args, _rets, _nonReturning, {}}); |
| 780 | return static_cast<uint16_t>(functionID); |
| 781 | } |
| 782 | |
| 783 | void Assembly::beginFunction(uint16_t _functionID) |
| 784 | { |