feat(furvm): add step function to executor

This commit is contained in:
2026-06-06 23:30:25 +02:00
parent bfdbbb0d5f
commit e7e5f36380
7 changed files with 115 additions and 2 deletions
+11 -1
View File
@@ -10,7 +10,7 @@ namespace furvm {
std::size_t thing_type_size(thing_t type) {
switch (type) {
case thing_t::Int: return 4;
case thing_t::Int32: return 4;
}
return 0;
}
@@ -28,6 +28,16 @@ thing_p thing::create(const context_p& context, thing_t type) {
return std::move(th);
}
std::int32_t& thing::int32() {
if (m_type != thing_t::Int32) throw bad_thing_access();
return *static_cast<std::int32_t*>(m_data);
}
const std::int32_t& thing::int32() const {
if (m_type != thing_t::Int32) throw bad_thing_access();
return *static_cast<std::int32_t*>(m_data);
}
} // namespace furvm
// NOLINTEND(cppcoreguidelines-no-malloc)