Skip to content

Commit

Permalink
Merge pull request #6060 from Goober5000/fix_std_move_crash
Browse files Browse the repository at this point in the history
fix crash caused by using a moved variable
  • Loading branch information
Goober5000 committed Mar 23, 2024
2 parents fecb9b1 + 4a1d794 commit f021e9d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions code/parse/sexp/sexp_lookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,14 @@ int add_dynamic_sexp(std::unique_ptr<DynamicSEXP>&& sexp, sexp_oper_type type)
new_op.value = free_op_index;
new_op.type = type;

sexp_help_struct new_help;
new_help.id = new_op.value;
new_help.help = sexp->getHelpText();

global.operator_const_mapping.insert(std::make_pair(new_op.value, std::move(sexp)));

// Now actually add the operator to the SEXP containers
Operators.push_back(new_op);

sexp_help_struct new_help;
new_help.id = new_op.value;
new_help.help = sexp->getHelpText();
Sexp_help.push_back(new_help);

return new_op.value;
Expand Down

0 comments on commit f021e9d

Please sign in to comment.