message: Apply data segments to memory in instantiate
diff: #include "stack.hpp"
  #include "types.hpp"
  #include <cassert>
  +#include <cstring>
  namespace fizzy
  {
  @@ -168,6 +169,22 @@ Instance instantiate(const Module& module)
  // NOTE: fill it with zeroes
  bytes memory(memory_min * page_size, 0);
  + // Fill out memory based on data segments
  + for (const auto& data : module.datasec)
  + {
  + uint64_t offset;
  + if (data.offset.kind == ConstantExpression::Kind::Constant)
  + offset = data.offset.value.constant;
  + else
  + throw std::runtime_error("data initialization by imported global is not supported yet");
  +
  + // FIXME: assert in parser
  + assert(data.memory_index == 0);
  + // NOTE: these instructions can overlap
  + assert((offset + data.init.size()) <= (memory_max * page_size));
  + std::memcpy(memory.data() + offset, data.init.data(), data.init.size());
  + }
  +
  // TODO: add imported globals first
  std::vector<uint64_t> globals;
  globals.reserve(module.globalsec.size());
  @@ -180,7 +197,8 @@ Instance instantiate(const Module& module)
  // TODO: initialize by imported global
  // Wasm spec section 3.3.7 constrains initialization by another global to imports only
  // https://webassembly.github.io/spec/core/valid/instructions.html#expressions
  - throw std::runtime_error("global initialization by imported global is not supported");
  + throw std::runtime_error(
  + "global initialization by imported global is not supported yet");
  }
  }
  