diff --git a/hphp/runtime/vm/translator/hopt/state_vector.h b/hphp/runtime/vm/translator/hopt/state_vector.h index 1f22cff90..f8a5ba56b 100644 --- a/hphp/runtime/vm/translator/hopt/state_vector.h +++ b/hphp/runtime/vm/translator/hopt/state_vector.h @@ -17,6 +17,8 @@ #ifndef incl_HPHP_JIT_STATE_VECTOR_H_ #define incl_HPHP_JIT_STATE_VECTOR_H_ +#include + #include "hphp/runtime/base/memory/memory_manager.h" #include "hphp/runtime/vm/translator/hopt/irfactory.h" @@ -39,6 +41,13 @@ struct StateVector { typedef typename InfoVector::reference reference; typedef typename InfoVector::const_reference const_reference; + static_assert( + std::is_same::value || + std::is_same::value || + std::is_same::value, + "StateVector can only be used with Block, IRInstruction, or SSATmp" + ); + StateVector(const IRFactory* factory, Info init) : m_factory(factory) , m_info(numIds(factory, static_cast(nullptr)), init)