Skip to content
Snippets Groups Projects
Commit b36a6244 authored by Kostyantyn Vorobyov's avatar Kostyantyn Vorobyov
Browse files

[tests] Fixed a few typos in the initialized test case

parent 74ca2189
No related branches found
No related tags found
No related merge requests found
...@@ -33,7 +33,7 @@ int main(void) { ...@@ -33,7 +33,7 @@ int main(void) {
/*@assert \initialized(&c) ; */ /*@assert \initialized(&c) ; */
/*@assert ! \initialized(&d) ; */ /*@assert ! \initialized(&d) ; */
/* Local variables also initialized by assignments */ /* Local variables can also be initialized by assignments */
b = 0; b = 0;
d[0] = 1; d[0] = 1;
/*@assert \initialized(&b); */ /*@assert \initialized(&b); */
...@@ -50,7 +50,7 @@ int main(void) { ...@@ -50,7 +50,7 @@ int main(void) {
q = (int*)calloc(1, sizeof(int)); q = (int*)calloc(1, sizeof(int));
/*@ assert \initialized(q); */ /*@ assert \initialized(q); */
/* Block reallocared using `realloc' carries initialization of the of the /* Block reallocared using `realloc' carries initialization of the
* existing fragment but does not initialize the newly allocated one */ * existing fragment but does not initialize the newly allocated one */
q = (int*)realloc(q, 2*sizeof(int)); q = (int*)realloc(q, 2*sizeof(int));
/*@assert \initialized(q); */ /*@assert \initialized(q); */
...@@ -58,19 +58,19 @@ int main(void) { ...@@ -58,19 +58,19 @@ int main(void) {
/*@assert ! \initialized(q); */ /*@assert ! \initialized(q); */
q--; q--;
/* Initialized on un-allocated regions is always false. This does not lead /* An initialized on an un-allocated region is always false. This does not
* to undefined bevaviours in production mode or assertion failures in debug * lead to undefined bevaviours in production mode or assertion failures in
* mode. */ * debug mode. */
free(p); free(p);
free(q); free(q);
/*@assert ! \initialized(p); */ /*@assert ! \initialized(p); */
/*@assert ! \initialized(q); */ /*@assert ! \initialized(q); */
/* Spoofing access to non-existing stack address */ /* Spoofing access to a non-existing stack address */
q = (int*)(&q - 1024*5); q = (int*)(&q - 1024*5);
/*assert ! \initialized(q); */ /*assert ! \initialized(q); */
/* Spoofing access to non-existing global address */ /* Spoofing access to a non-existing global address */
q = (int*)128; q = (int*)128;
/*@assert ! \initialized(q); */ /*@assert ! \initialized(q); */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment