C++: add good example for DeadCodeGoto

This commit is contained in:
Robert Marsh
2018-10-17 11:58:51 -07:00
parent 17537bb88b
commit b40219bb01

View File

@@ -1,3 +1,7 @@
goto err;
free(pointer);
err: return -1;
goto err1;
free(pointer); // BAD: this line is unreachable
err1: return -1;
free(pointer); // GOOD: this line is reachable
goto err2;
err2: return -1;