| 1 | module NilBig; |
| 2 | (* A field of a nil pointer past the page at address 0 that is never |
| 3 | mapped, which the machine wouldn't catch: the code tests for nil *) |
| 4 | import Out; |
| 5 | |
| 6 | type Big = record pad: [100000]U8; last: I64; end; |
| 7 | |
| 8 | var p: ^Big; |
| 9 | |
| 10 | proc main*; |
| 11 | begin |
| 12 | Out.str("before"); Out.ln; |
| 13 | Out.flush; |
| 14 | p^.last := 1; |
| 15 | Out.str("after"); Out.ln; |
| 16 | end; |
| 17 | |
| 18 | end NilBig. |