Skip to content

Commit

Permalink
9745: Do not restrict Field tag in return opcode
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanmon committed Nov 12, 2024
1 parent 9e6c19c commit a22da27
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3050,7 +3050,6 @@ ReturnDataError AvmTraceBuilder::op_return(uint8_t indirect, uint32_t ret_offset

bool op_valid = tag_match && check_tag(AvmMemoryTag::U32, resolved_ret_size_offset);
const auto ret_size = static_cast<uint32_t>(unconstrained_read_from_memory(resolved_ret_size_offset));
op_valid = op_valid && check_tag_range(AvmMemoryTag::FF, resolved_ret_offset, ret_size);

gas_trace_builder.constrain_gas(clk, OpCode::RETURN, ret_size);

Expand Down
1 change: 0 additions & 1 deletion yarn-project/simulator/src/avm/opcodes/external_calls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ export class Return extends Instruction {
const returnSize = memory.get(returnSizeOffset).toNumber();
context.machineState.consumeGas(this.gasCost(returnSize));

memory.checkTagsRange(TypeTag.FIELD, returnOffset, returnSize);
const output = memory.getSlice(returnOffset, returnSize).map(word => word.toFr());

context.machineState.return(output);
Expand Down

0 comments on commit a22da27

Please sign in to comment.