Skip to content

Commit

Permalink
more gcc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fcarreiro committed Jan 10, 2025
1 parent 6c1dab3 commit 8a5ac30
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void Execution::mov(ContextInterface& context, MemoryAddress src_addr, MemoryAdd
{
auto& memory = context.get_memory();
auto [value, tag] = memory.get(src_addr);
memory.set(dst_addr, std::move(value), tag);
memory.set(dst_addr, value, tag);
}

// TODO: This will need to happen in its own gadget in any case.
Expand All @@ -40,7 +40,7 @@ void Execution::call(ContextInterface& context, MemoryAddress addr)
const auto [contract_address, _] = memory.get(addr);
std::vector<FF> calldata = {};

auto nested_context = context_provider.make(std::move(contract_address),
auto nested_context = context_provider.make(contract_address,
/*msg_sender=*/context.get_address(),
/*calldata=*/calldata,
/*is_static=*/false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ ContractInstance HintedRawDataDB::get_contract_instance(const AztecAddress& addr
assert(contract_instances_idx < contract_instances.size());
auto contract_instance_hint = contract_instances[contract_instances_idx];
assert(contract_instance_hint.address == address);
(void)address; // Avoid GCC unused parameter warning when asserts are disabled.

return {
.address = contract_instance_hint.address,
.salt = contract_instance_hint.salt,
Expand All @@ -40,6 +42,8 @@ ContractClass HintedRawDataDB::get_contract_class(const ContractClassId& class_i
assert(class_id == compute_contract_class_id(contract_class_hint.artifactHash,
contract_class_hint.privateFunctionsRoot,
contract_class_hint.publicBytecodeCommitment));
(void)class_id; // Avoid GCC unused parameter warning when asserts are disabled.

return {
.artifact_hash = contract_class_hint.artifactHash,
.private_function_root = contract_class_hint.privateFunctionsRoot,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ Instruction decode_instruction(std::span<const uint8_t> bytecode, size_t pos)
const auto starting_pos = pos;

assert(pos < bytecode_length);
(void)bytecode_length; // Avoid GCC unused parameter warning when asserts are disabled.
// if (pos >= length) {
// info("Position is out of range. Position: " + std::to_string(pos) +
// " Bytecode length: " + std::to_string(length));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ template <typename LookupSettings_> class BaseLookupTraceBuilder {
// The complexity is O(|src_selector|) * O(find_in_dst).
trace.visit_column(LookupSettings::SRC_SELECTOR, [&](uint32_t row, const FF& src_sel_value) {
assert(src_sel_value == 1);
(void)src_sel_value; // Avoid GCC complaining of unused parameter when asserts are disabled.

auto src_values = trace.get_multiple(LookupSettings::SRC_COLUMNS, row);
uint32_t dst_row = find_in_dst(src_values); // Assumes an efficient implementation.
Expand Down Expand Up @@ -63,6 +64,8 @@ template <typename LookupSettings_> class LookupIntoDynamicTable : public BaseLo
row_idx.reserve(trace.get_column_rows(LookupSettings::DST_SELECTOR));
trace.visit_column(LookupSettings::DST_SELECTOR, [&](uint32_t row, const FF& dst_sel_value) {
assert(dst_sel_value == 1);
(void)dst_sel_value; // Avoid GCC complaining of unused parameter when asserts are disabled.

auto dst_values = trace.get_multiple(LookupSettings::DST_COLUMNS, row);
row_idx.insert({ get_key(dst_values), row });
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ template <typename PermutationSettings> class PermutationBuilder {
// Let "src_sel {c1, c2, ...} is dst_sel {d1, d2, ...}" be a permutation.
trace.visit_column(PermutationSettings::SRC_SELECTOR, [&](uint32_t row, const FF& src_sel_value) {
assert(src_sel_value == 1);
(void)src_sel_value; // Avoid GCC complaining of unused parameter when asserts are disabled.

// We set a dummy value in the inverse column so that the size of the column is right.
// The correct value will be set by the prover.
Expand Down

0 comments on commit 8a5ac30

Please sign in to comment.