Skip to content

Commit

Permalink
Fix compiler error on ast wrong implicit construct push_back
Browse files Browse the repository at this point in the history
gcc/rust/ChangeLog:

	* expand/rust-macro-builtins-asm.cc (parse_reg_operand_in): Fix
	compiler error on ast wrong implicit construct push_back
  • Loading branch information
badumbatish authored and P-E-P committed Oct 17, 2024
1 parent 2d95e15 commit 6708d35
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gcc/rust/expand/rust-macro-builtins-asm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ parse_reg_operand_in (InlineAsmContext inline_asm_ctx)
// For the keyword IN, currently we count it as a seperate keyword called
// Rust::IN search for #define RS_TOKEN_LIST in code base.
auto &parser = inline_asm_ctx.parser;
location_t locus = parser.peek_current_token ()->get_locus ();
if (!inline_asm_ctx.is_global_asm () && parser.skip_token (IN))
{
auto reg = parse_reg (inline_asm_ctx);
Expand All @@ -331,7 +332,7 @@ parse_reg_operand_in (InlineAsmContext inline_asm_ctx)
// TODO: When we've succesfully parse an expr, remember to clone_expr()
// instead of nullptr
struct AST::InlineAsmOperand::In in (reg, std::move (expr));
inline_asm_ctx.inline_asm.operands.push_back (in);
inline_asm_ctx.inline_asm.operands.emplace_back (in, locus);
return inline_asm_ctx;
}
return tl::unexpected<InlineAsmParseError> (NONCOMMITED);
Expand Down

0 comments on commit 6708d35

Please sign in to comment.