diff options
Diffstat (limited to 'runtime/utils.h')
-rw-r--r-- | runtime/utils.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/utils.h b/runtime/utils.h index 0fbc9df..3191e7d 100644 --- a/runtime/utils.h +++ b/runtime/utils.h @@ -546,7 +546,13 @@ class VoidFunctor { } }; -void PushWord(std::vector<uint8_t>* buf, int32_t data); +template <typename Alloc> +void Push32(std::vector<uint8_t, Alloc>* buf, int32_t data) { + buf->push_back(data & 0xff); + buf->push_back((data >> 8) & 0xff); + buf->push_back((data >> 16) & 0xff); + buf->push_back((data >> 24) & 0xff); +} void EncodeUnsignedLeb128(uint32_t data, std::vector<uint8_t>* buf); void EncodeSignedLeb128(int32_t data, std::vector<uint8_t>* buf); |