diff --git a/src/rt/rust_shape.h b/src/rt/rust_shape.h index e871900d65f..769c4981ef9 100644 --- a/src/rt/rust_shape.h +++ b/src/rt/rust_shape.h @@ -168,6 +168,24 @@ get_u16_bump(const uint8_t *&addr) { return result; } +template +inline void +fmt_number(std::ostream &out, T n) { + out << n; +} + +// Override the character interpretation for these two. +template<> +inline void +fmt_number(std::ostream &out, uint8_t n) { + out << (int)n; +} +template<> +inline void +fmt_number(std::ostream &out, int8_t n) { + out << (int)n; +} + // Contexts @@ -1015,7 +1033,7 @@ private: const type_param *params, const uint8_t *end_sp, bool live); template - void walk_number() { out << get_dp(dp); } + inline void walk_number() { fmt_number(out, get_dp(dp)); } public: log(rust_task *in_task,