From 291c037b8b6b553b0c7a8ec9ba08663c009cbf17 Mon Sep 17 00:00:00 2001 From: Jeong Yunwon Date: Fri, 20 May 2022 07:49:37 +0900 Subject: [PATCH] ensure bytecode::Instruction never grows more than 8bytes --- Cargo.lock | 1 + bytecode/Cargo.toml | 1 + bytecode/src/lib.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 881aa742e..7805c12c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1616,6 +1616,7 @@ dependencies = [ "num-bigint", "num-complex", "serde", + "static_assertions", ] [[package]] diff --git a/bytecode/Cargo.toml b/bytecode/Cargo.toml index db83f9010..1457072b8 100644 --- a/bytecode/Cargo.toml +++ b/bytecode/Cargo.toml @@ -17,3 +17,4 @@ num-complex = { version = "0.4.0", features = ["serde"] } serde = { version = "1.0.136", features = ["derive"] } itertools = "0.10.3" bstr = "0.2.17" +static_assertions = "1.1.0" diff --git a/bytecode/src/lib.rs b/bytecode/src/lib.rs index 75a8962c0..76e39ea37 100644 --- a/bytecode/src/lib.rs +++ b/bytecode/src/lib.rs @@ -401,6 +401,7 @@ pub enum Instruction { i: u32, }, } +static_assertions::assert_eq_size!(Instruction, u64); use self::Instruction::*;