mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 09:21:04 +01:00
Ensure we evaluate instructions created in uncommon ways. (#3598)
Instructions created by splices during conversion are now evaluated, as are instructions created in cases where we first create a placeholder instruction and later replace it by a different instruction. This also removes the ability to set a parse node and instruction independently after creating an `InstId`, which could lead to them accidentally not matching.
This commit is contained in:
@@ -40,9 +40,9 @@ auto HandleStructFieldValue(Context& context,
|
||||
auto [name_node, name_id] = context.node_stack().PopNameWithParseNode();
|
||||
|
||||
// Store the name for the type.
|
||||
context.args_type_info_stack().AddInst(
|
||||
context.args_type_info_stack().AddInstId(context.AddInstInNoBlock(
|
||||
{name_node, SemIR::StructTypeField{
|
||||
name_id, context.insts().Get(value_inst_id).type_id()}});
|
||||
name_id, context.insts().Get(value_inst_id).type_id()}}));
|
||||
|
||||
// Push the value back on the stack as an argument.
|
||||
context.node_stack().Push(parse_node, value_inst_id);
|
||||
|
||||
Reference in New Issue
Block a user