Skip to content

Commit

Permalink
Ensure that GateDataMapHashEntry is not trivially default-initialized. (
Browse files Browse the repository at this point in the history
#742)

This ensures that the ids of elements of a default constructed
std::array of GateDataMapHashEntry do not have indeterminate values.
  • Loading branch information
folded authored Apr 9, 2024
1 parent 8f8988a commit bd6ae6e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/stim/gates/gates.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#ifndef _STIM_GATES_GATE_DATA_H
#define _STIM_GATES_GATE_DATA_H

#include <array>
#include <cassert>
#include <complex>
#include <cstdint>
Expand Down Expand Up @@ -313,7 +314,7 @@ inline bool _case_insensitive_mismatch(std::string_view text1, std::string_view
}

struct GateDataMapHashEntry {
GateType id;
GateType id = GateType::NOT_A_GATE;
std::string_view expected_name;
};

Expand Down

0 comments on commit bd6ae6e

Please sign in to comment.