diff --git a/eg/rudiments/errorful/add.60p b/eg/rudiments/errorful/add.60p index ba653a4..fdd49e7 100644 --- a/eg/rudiments/errorful/add.60p +++ b/eg/rudiments/errorful/add.60p @@ -1,3 +1,8 @@ +// should fail analysis with an UnmeaningfulReadError +// because adding 4 to the accumulator reads the carry +// but the carry has neither been provided as input +// nor set to anything in particular by this routine. + define add_four routine inputs a outputs a diff --git a/eg/rudiments/errorful/range.60p b/eg/rudiments/errorful/range.60p index 87e1095..941c82b 100644 --- a/eg/rudiments/errorful/range.60p +++ b/eg/rudiments/errorful/range.60p @@ -1,3 +1,7 @@ +// should fail analysis with a RangeExceededError +// because the index is detected to fall outside the +// allowable range of the table it is indexing. + byte table[8] message : "WHAT?" define main routine diff --git a/eg/rudiments/errorful/vector.60p b/eg/rudiments/errorful/vector.60p index 3671924..55b7a21 100644 --- a/eg/rudiments/errorful/vector.60p +++ b/eg/rudiments/errorful/vector.60p @@ -1,9 +1,14 @@ -vector vec +// should fail analysis with a ConstantConstraintError +// because it cannot copy the address of `foo` into `vec` +// because it has incompatible constraints. + +vector routine inputs y outputs y trashes z, n + vec -routine foo +define foo routine inputs x outputs x trashes z, n @@ -11,7 +16,7 @@ routine foo inc x } -routine main +define main routine inputs foo outputs vec trashes a, z, n