about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--subx/011run.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/subx/011run.cc b/subx/011run.cc
index da5af920..6b18ca06 100644
--- a/subx/011run.cc
+++ b/subx/011run.cc
@@ -364,10 +364,8 @@ case 0x05: {  // add imm32 to EAX
 :(code)
 // read a 32-bit int in little-endian order from the instruction stream
 int32_t next32() {
-  int32_t result = next();
-  result |= (next()<<8);
-  result |= (next()<<16);
-  result |= (next()<<24);
+  int32_t result = read_mem_i32(EIP);
+  EIP+=4;
   return result;
 }