raz / test / run / NilPointer.raz

16 lines · 273 B · raw · history · last change 389c4f3a

1module NilPointer;
2(* Following nil stops the program with SIGSEGV, after saying where *)
3import Out;
4
5type Cell = record next: ^Cell; v: I64; end;
6
7proc main*;
8var c: Cell;
9begin
10 c.v := 1;
11 Out.int(c.v);
12 Out.flush;
13 Out.int(c.next^.v);
14end;
15
16end NilPointer.