about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
Diffstat (limited to 'subx')
-rw-r--r--subx/010---vm.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/subx/010---vm.cc b/subx/010---vm.cc
index 33ebe51a..92cf7d14 100644
--- a/subx/010---vm.cc
+++ b/subx/010---vm.cc
@@ -120,15 +120,16 @@ inline uint8_t* mem_addr_u8(uint32_t addr) {
 inline int8_t* mem_addr_i8(uint32_t addr) {
   return reinterpret_cast<int8_t*>(&Mem.at(addr-Mem_offset));
 }
-inline char* mem_addr_string(uint32_t addr) {
-  return reinterpret_cast<char*>(&Mem.at(addr-Mem_offset));
-}
 inline uint32_t* mem_addr_u32(uint32_t addr) {
   return reinterpret_cast<uint32_t*>(&Mem.at(addr-Mem_offset));
 }
 inline int32_t* mem_addr_i32(uint32_t addr) {
   return reinterpret_cast<int32_t*>(&Mem.at(addr-Mem_offset));
 }
+// helper for some syscalls. But read-only.
+inline const char* mem_addr_string(uint32_t addr) {
+  return reinterpret_cast<const char*>(&Mem.at(addr-Mem_offset));
+}
 
 inline void write_mem_u8(uint32_t addr, uint8_t val) {
   Mem.at(addr-Mem_offset) = val;