From 7b2e06aa3a0b6cef9568c3eab010a7187b9b6803 Mon Sep 17 00:00:00 2001 From: Bruce He <44327446+zm2he@users.noreply.github.com> Date: Thu, 29 Jun 2023 20:16:40 +0000 Subject: Dynamic Sized Bitvector Powerset Lattice for Static Analysis (#5784) This change introduces a finite-height powerset lattice FinitePowersetLattice where each element's height is determined when constructed in runtime. This is implemented using a vector of `bools. This change also modifies BlockState and MonotoneCFGAnalyzer to be templated on a generic lattice type instead of using a hardcoded lattice. It additionally fixes an iterator bug in MonotoneCFGAnalyzer::fromCFG which assigned a temporary iterator object as predecessor and successor pointers to BlockStates instead of pointers to actual BlockState objects. --- src/analysis/sign-lattice.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/analysis/sign-lattice.cpp') diff --git a/src/analysis/sign-lattice.cpp b/src/analysis/sign-lattice.cpp index 9baa2f2fd..0d9379938 100644 --- a/src/analysis/sign-lattice.cpp +++ b/src/analysis/sign-lattice.cpp @@ -11,11 +11,9 @@ private: Sign value; public: - static bool isTop(const SignLattice& element) { return element.value == TOP; } + bool isTop() { return value == TOP; } - static bool isBottom(const SignLattice& element) { - return element.value == BOTTOM; - } + bool isBottom() { return value == BOTTOM; } static LatticeComparison compare(const SignLattice& left, const SignLattice& right) { @@ -44,6 +42,4 @@ public: } }; -static_assert(is_lattice); - } // namespace wasm::analysis -- cgit v1.2.3