fix waittillmatch operation
This commit is contained in:
@ -214,7 +214,6 @@ void assembler::assemble_instruction(const gsc::instruction_ptr& inst)
|
||||
case opcode::OP_vector:
|
||||
case opcode::OP_bit_or:
|
||||
case opcode::OP_AddArray:
|
||||
case opcode::OP_waittillmatch2:
|
||||
case opcode::OP_shift_right:
|
||||
script_->write<std::uint8_t>(static_cast<std::uint8_t>(inst->opcode));
|
||||
break;
|
||||
@ -262,7 +261,8 @@ void assembler::assemble_instruction(const gsc::instruction_ptr& inst)
|
||||
break;
|
||||
case opcode::OP_waittillmatch:
|
||||
script_->write<std::uint8_t>(static_cast<std::uint8_t>(inst->opcode));
|
||||
script_->write<std::uint16_t>(0);
|
||||
script_->write<std::uint8_t>(static_cast<std::uint8_t>(std::stoi(inst->data[0])));
|
||||
script_->write<std::uint8_t>(static_cast<std::uint8_t>(opcode::OP_waittillmatch2));
|
||||
break;
|
||||
case opcode::OP_SetNewLocalVariableFieldCached0:
|
||||
case opcode::OP_EvalNewLocalArrayRefCached0:
|
||||
|
@ -93,10 +93,6 @@ void compiler::compile_program(const gsc::program_ptr& program)
|
||||
{
|
||||
emit_define(def);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_GSC_COMPILER
|
||||
print_debug_info();
|
||||
#endif
|
||||
}
|
||||
|
||||
void compiler::emit_include(const gsc::include_ptr& include)
|
||||
@ -302,7 +298,7 @@ void compiler::emit_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::s
|
||||
emit_expr_arguments(ctx, stmt->args);
|
||||
emit_expr(ctx, stmt->expr);
|
||||
emit_expr(ctx, stmt->obj);
|
||||
emit_opcode(ctx, opcode::OP_waittillmatch);
|
||||
emit_opcode(ctx, opcode::OP_waittillmatch, utils::string::va("%d", stmt->args->list.size()));
|
||||
emit_opcode(ctx, opcode::OP_clearparams);
|
||||
}
|
||||
|
||||
|
@ -1452,7 +1452,9 @@ void decompiler::decompile_statements(const gsc::function_ptr& func)
|
||||
gsc::expr_arguments_ptr args = std::make_unique<gsc::node_expr_arguments>();
|
||||
args->loc = loc;
|
||||
|
||||
while(stack_.size() > 0)
|
||||
auto argnum = std::stoul(inst->data[0]);
|
||||
|
||||
for (auto i = 0u; i < argnum; i++)
|
||||
{
|
||||
auto node = std::move(stack_.top());
|
||||
stack_.pop();
|
||||
|
@ -153,7 +153,6 @@ void disassembler::dissasemble_instruction(const gsc::instruction_ptr& inst)
|
||||
case opcode::OP_vector:
|
||||
case opcode::OP_bit_or:
|
||||
case opcode::OP_AddArray:
|
||||
case opcode::OP_waittillmatch2:
|
||||
case opcode::OP_shift_right:
|
||||
break;
|
||||
case opcode::OP_GetByte:
|
||||
@ -193,7 +192,8 @@ void disassembler::dissasemble_instruction(const gsc::instruction_ptr& inst)
|
||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
||||
break;
|
||||
case opcode::OP_waittillmatch:
|
||||
inst->data.push_back(utils::string::va("%i", script_->read<std::uint16_t>()));
|
||||
inst->data.push_back(utils::string::va("%i", script_->read<std::uint8_t>()));
|
||||
script_->seek(1);
|
||||
break;
|
||||
case opcode::OP_SetNewLocalVariableFieldCached0:
|
||||
case opcode::OP_EvalNewLocalArrayRefCached0:
|
||||
|
@ -81,7 +81,6 @@ auto opcode_size(std::uint8_t id) -> std::uint32_t
|
||||
case opcode::OP_vector:
|
||||
case opcode::OP_bit_or:
|
||||
case opcode::OP_AddArray:
|
||||
case opcode::OP_waittillmatch2:
|
||||
case opcode::OP_shift_right:
|
||||
return 1;
|
||||
case opcode::OP_SetNewLocalVariableFieldCached0:
|
||||
|
Reference in New Issue
Block a user