about summary refs log tree commit diff stats
path: root/044space.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-09-30 00:07:33 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-09-30 01:01:34 -0700
commita0fc38c9e1584960ecad0eb8d58a5d4e6995ad87 (patch)
tree4a2c9a8120ea6d59dd371b575b0d1215a2c6aaaf /044space.cc
parentc6b3b04ac85f05065fef9626270d914dc4428484 (diff)
downloadmu-a0fc38c9e1584960ecad0eb8d58a5d4e6995ad87.tar.gz
2218 - check types in instructions much earlier
Front-loads it a bit more than I'd like, but the payoff is that other
recipes will now be able to describe the type checks right next to their
operation.

I'm also introducing a new use of /raw with literals to indicate unsafe
typecasts.
Diffstat (limited to '044space.cc')
-rw-r--r--044space.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/044space.cc b/044space.cc
index eddf457e..a9251364 100644
--- a/044space.cc
+++ b/044space.cc
@@ -7,7 +7,7 @@
 # then location 0 is really location 11, location 1 is really location 12, and so on.
 recipe main [
   10:number <- copy 5  # pretend array; in practice we'll use new
-  default-space:address:array:location <- copy 10
+  default-space:address:array:location <- copy 10/raw
   1:number <- copy 23
 ]
 +mem: storing 23 in location 12
@@ -19,8 +19,8 @@ recipe main [
   # pretend array
   1000:number <- copy 5
   # actual start of this recipe
-  default-space:address:array:location <- copy 1000
-  1:address:number <- copy 3
+  default-space:address:array:location <- copy 1000/raw
+  1:address:number <- copy 3/raw
   8:number/raw <- copy *1:address:number
 ]
 +mem: storing 34 in location 8
@@ -74,8 +74,8 @@ recipe main [
   # pretend array
   1000:number <- copy 5
   # actual start of this recipe
-  default-space:address:array:location <- copy 1000
-  1:address:point <- copy 12
+  default-space:address:array:location <- copy 1000/raw
+  1:address:point <- copy 12/raw
   9:number/raw <- get *1:address:point, 1:offset
 ]
 +mem: storing 35 in location 9
@@ -94,8 +94,8 @@ recipe main [
   # pretend array
   1000:number <- copy 5
   # actual start of this recipe
-  default-space:address:array:location <- copy 1000
-  1:address:array:number <- copy 12
+  default-space:address:array:location <- copy 1000/raw
+  1:address:array:number <- copy 12/raw
   9:number/raw <- index *1:address:array:number, 1
 ]
 +mem: storing 35 in location 9
@@ -219,8 +219,8 @@ long long int address(long long int offset, long long int base) {
 
 :(scenario get_default_space)
 recipe main [
-  default-space:address:array:location <- copy 10
-  1:number/raw <- copy default-space:address:array:location
+  default-space:address:array:location <- copy 10/raw
+  1:address:array:location/raw <- copy default-space:address:array:location
 ]
 +mem: storing 10 in location 1