source: CIVL/examples/languageFeatures/mallocBad2.cvl@ d410676

1.23 2.0 main test-branch
Last change on this file since d410676 was 1f192b0, checked in by Tim Zirkel <zirkeltk@…>, 13 years ago

Added some examples of improper malloc use.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@175 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 197 bytes
Line 
1#include <civlc.h>
2
3// Uses pointer with no malloc.
4void main() {
5 $heap h;
6 double *p; // = (double *) $malloc(&h, 5*sizeof(double));
7
8 p[4]=3.14;
9 $assert(p[4]==3.14);
10 $free(&h, p);
11}
Note: See TracBrowser for help on using the repository browser.