Mercurial > urweb
annotate tests/openRedef.ur @ 2070:382911d72e63
Check realloc's return code to prevent segfault on out of memory condition (Part 3)
author | Sergey Mironov <grrwlf@gmail.com> |
---|---|
date | Tue, 02 Sep 2014 17:37:22 +0000 |
parents | cccf8bf64b30 |
children |
rev | line source |
---|---|
adam@1527 | 1 structure M = struct |
adam@1527 | 2 con num = int |
adam@1527 | 3 val zero = 0 |
adam@1527 | 4 end |
adam@1527 | 5 |
adam@1527 | 6 structure N = struct |
adam@1527 | 7 open M |
adam@1527 | 8 con num = num * num |
adam@1527 | 9 val zero = zero + 1 |
adam@1527 | 10 end |
adam@1527 | 11 |
adam@1527 | 12 structure O = struct |
adam@1527 | 13 open N |
adam@1527 | 14 |
adam@1527 | 15 val one : num = (zero + 1, zero) |
adam@1527 | 16 end |