source:
CIVL/examples/languageFeatures/mallocBad2.cvl@
1258be5
| Last change on this file since 1258be5 was 36b5ada, checked in by , 12 years ago | |
|---|---|
|
|
| File size: 214 bytes | |
| Rev | Line | |
|---|---|---|
| [36b5ada] | 1 | /* Commandline execution: |
| 2 | * civl verify mallocBad2.cvl | |
| 3 | * */ | |
| [1f192b0] | 4 | #include <civlc.h> |
| 5 | void main() { | |
| 6 | $heap h; | |
| [36b5ada] | 7 | double *p; |
| [1f192b0] | 8 | |
| [36b5ada] | 9 | // Uses pointer without malloc. |
| [1f192b0] | 10 | p[4]=3.14; |
| 11 | $assert(p[4]==3.14); | |
| 12 | $free(&h, p); | |
| 13 | } |
Note:
See TracBrowser
for help on using the repository browser.
