about summary refs log tree commit diff stats
path: root/mu_instructions
diff options
context:
space:
mode:
Diffstat (limited to 'mu_instructions')
-rw-r--r--mu_instructions6
1 files changed, 5 insertions, 1 deletions
diff --git a/mu_instructions b/mu_instructions
index 945528ad..ea58866e 100644
--- a/mu_instructions
+++ b/mu_instructions
@@ -374,10 +374,14 @@ If a record (product) type T was defined to have elements a, b, c, ... of
 types T_a, T_b, T_c, ..., then accessing one of those elements f of type T_f:
 
 var/reg: (addr T_f) <- get var2/reg2: (addr T), f
-  => "8d/copy-address *(" reg2 "+" offset(f) ") " reg "/r32"
+  => "81 7/subop/compare %" reg2 " 0/imm32"
+     "0f 84/jump-if-= __mu-abort-null-get-base-address/disp32"
+     "8d/copy-address *(" reg2 "+" offset(f) ") " reg "/r32"
 var/reg: (addr T_f) <- get var2: T, f
   => "8d/copy-address *(ebp+" var2.stack-offset "+" offset(f) ") " reg "/r32"
 
+When the base is an address we perform a null check.
+
 # Allocating memory
 
 allocate in: (addr handle T)