diff options
author | Kartik Agaram <vc@akkartik.com> | 2018-06-15 22:12:03 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2018-06-15 22:12:03 -0700 |
commit | 0edd9b9fc60440213e4df926ea511419ee291f1e (patch) | |
tree | 84b22f7afdeb9110ad7105c5fc070dacff178502 /074wait.cc | |
parent | 3f34ac9369978b396d00a4fd02c9fb06b8eea621 (diff) | |
download | mu-0edd9b9fc60440213e4df926ea511419ee291f1e.tar.gz |
4257 - abortive attempt at safe fat pointers
I've been working on this slowly over several weeks, but it's too hard to support 0 as the null value for addresses. I constantly have to add exceptions for scalar value corresponding to an address type (now occupying 2 locations). The final straw is the test for 'reload': x:num <- reload text 'reload' returns an address. But there's no way to know that for arbitrary instructions. New plan: let's put this off for a bit and first create support for literals. Then use 'null' instead of '0' for addresses everywhere. Then it'll be easy to just change what 'null' means.
Diffstat (limited to '074wait.cc')
-rw-r--r-- | 074wait.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/074wait.cc b/074wait.cc index eb17c8aa..47bbb0cc 100644 --- a/074wait.cc +++ b/074wait.cc @@ -262,22 +262,23 @@ def main [ :(scenario get_location_indirect) # 'get-location' can read from container address def main [ - 1:num <- copy 10 - 10:num <- copy 34 - 11:num <- copy 35 + 1:&:point <- copy 10/unsafe + # skip alloc id + 11:num <- copy 34 + 12:num <- copy 35 4:location <- get-location 1:&:point/lookup, 0:offset ] -+mem: storing 10 in location 4 ++mem: storing 11 in location 4 :(scenario get_location_indirect_2) def main [ - 1:num <- copy 10 - 10:num <- copy 34 - 11:num <- copy 35 + 1:&:point <- copy 10/unsafe + 11:num <- copy 34 + 12:num <- copy 35 4:&:num <- copy 20/unsafe 4:&:location/lookup <- get-location 1:&:point/lookup, 0:offset ] -+mem: storing 10 in location 20 ++mem: storing 11 in location 21 //: allow waiting on a routine to complete |