source: CIVL/examples/languageFeatures/mallocBad4.cvl@ 90dd7d7

1.23 2.0 main test-branch
Last change on this file since 90dd7d7 was 5252db6, checked in by Stephen Siegel <siegel@…>, 13 years ago

Transforming to find multiple errors and to use log functionality in GMC.

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

  • Property mode set to 100644
File size: 293 bytes
Line 
1#include <civlc.h>
2
3// Reassign heap before free.
4// This is actually illegal now since there is a limitation of
5// one heap per scope...
6void main() {
7 $heap h, h0;
8 double *p = (double *) $malloc(&h, 5*sizeof(double));
9
10 h = h0;
11 p[4]=3.14;
12 $assert(p[4]==3.14);
13 $free(&h, p);
14}
Note: See TracBrowser for help on using the repository browser.