| 104 | } |
| 105 | |
| 106 | var function::call_rl(const function *_this, vector &args) |
| 107 | { |
| 108 | current_process->poll_event(); |
| 109 | if (args.size() != _this->mArgs.size()) |
| 110 | throw runtime_error( |
| 111 | "Wrong size of arguments. Expected " + std::to_string(_this->mArgs.size()) + ", provided " + |
| 112 | std::to_string(args.size())); |
| 113 | scope_guard scope(_this->mContext); |
| 114 | #ifdef CS_DEBUGGER |
| 115 | fcall_guard fcall(_this->mDecl); |
| 116 | if (_this->mMatch) |
| 117 | cs_debugger_func_callback(_this->mDecl, _this->mStmt); |
| 118 | #endif |
| 119 | for (std::size_t i = 0; i < args.size(); ++i) |
| 120 | _this->mContext->instance->storage.add_var_no_return(_this->mArgs[i].data(), args[i]); |
| 121 | try { |
| 122 | return _this->mContext->instance->parse_expr(static_cast<const statement_return *>(_this->mBody.front())->get_tree().root()); |
| 123 | } |
| 124 | catch (const cs::exception &e) { |
| 125 | throw e; |
| 126 | } |
| 127 | catch (const std::exception &e) { |
| 128 | const statement_base *ptr = _this->mBody.front(); |
| 129 | throw exception(ptr->get_line_num(), ptr->get_file_path(), ptr->get_raw_code(), e.what()); |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | var function::call_el(const function *_this, vector &args) |
| 134 | { |
nothing calls this directly
no test coverage detected