From 2f5f7919fd29ff05a8f182d3cb1aa9d168b58b66 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 29 Mar 2015 10:21:15 -0700 Subject: 994 - spaces now check bounds I'm not testing for bounds-check errors yet, though. --- cpp/028space_surround | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'cpp/028space_surround') diff --git a/cpp/028space_surround b/cpp/028space_surround index 9899ed89..7126911d 100644 --- a/cpp/028space_surround +++ b/cpp/028space_surround @@ -7,16 +7,18 @@ :(scenario "surrounding_space") # location 1 in space 1 refers to the space surrounding the default space, here 20. recipe main [ + 10:integer <- copy 5:literal # pretend array + 20:integer <- copy 5:literal # pretend array default-space:address:space <- copy 10:literal 0:address:space <- copy 20:literal 1:integer <- copy 32:literal 1:integer/space:1 <- copy 33:literal ] -+run: instruction main/1 ++run: instruction main/3 +mem: storing 20 in location 11 -+run: instruction main/2 ++run: instruction main/4 +mem: storing 32 in location 12 -+run: instruction main/3 ++run: instruction main/5 +mem: storing 33 in location 22 //: If you think of a space as a collection of variables with a common -- cgit 1.4.1-2-gfad0