summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/AST.v1
-rw-r--r--common/Mem.v4
2 files changed, 5 insertions, 0 deletions
diff --git a/common/AST.v b/common/AST.v
index e7b85a9..13e84dd 100644
--- a/common/AST.v
+++ b/common/AST.v
@@ -91,6 +91,7 @@ Inductive init_data: Type :=
| Init_float32: float -> init_data
| Init_float64: float -> init_data
| Init_space: Z -> init_data
+ | Init_addrof: ident -> int -> init_data (**r address of symbol + offset *)
| Init_pointer: list init_data -> init_data.
(** Whole programs consist of:
diff --git a/common/Mem.v b/common/Mem.v
index 01c1975..6510828 100644
--- a/common/Mem.v
+++ b/common/Mem.v
@@ -568,6 +568,9 @@ Fixpoint contents_init_data (pos: Z) (id: list init_data) {struct id}: contentma
setN 7%nat pos (Vfloat f) (contents_init_data (pos + 1) id')
| Init_space n :: id' =>
contents_init_data (pos + Zmax n 0) id'
+ | Init_addrof s n :: id' =>
+ (* Not handled properly yet *)
+ contents_init_data (pos + 4) id'
| Init_pointer x :: id' =>
(* Not handled properly yet *)
contents_init_data (pos + 4) id'
@@ -581,6 +584,7 @@ Definition size_init_data (id: init_data) : Z :=
| Init_float32 _ => 4
| Init_float64 _ => 8
| Init_space n => Zmax n 0
+ | Init_addrof _ _ => 4
| Init_pointer _ => 4
end.