start adding fuzzing
[bigint-presentation-code.git] / register_allocator / src / error.rs
index d8e27d1a62e43a9bf1f967c991428bca8a4a4899..13c041451bb227d3b711fcb7c198fcedfcfd7332 100644 (file)
@@ -231,6 +231,22 @@ pub enum Error {
         found: Option<BlockIdx>,
         expected: Option<BlockIdx>,
     },
+    #[error(
+        "critical edges are not allowed: source block {src_block} has \
+        multiple successors and target block {tgt_block} has multiple \
+        predecessors: source block's terminating branch {branch_inst}"
+    )]
+    CriticalEdgeNotAllowed {
+        src_block: BlockIdx,
+        branch_inst: InstIdx,
+        tgt_block: BlockIdx,
+    },
 }
 
 pub type Result<T, E = Error> = std::result::Result<T, E>;
+
+impl From<Error> for arbitrary::Error {
+    fn from(_value: Error) -> Self {
+        Self::IncorrectFormat
+    }
+}