#177: EXC_BAD_ACCESS in CarpetIOASCII
| Reporter: | Ian Hinder |
| Status: | closed |
| Milestone: | |
| Version: | |
| Type: | bug |
| Priority: | minor |
| Component: | Carpet |
Comment (by Roland Haas):
My guess would be that this is related to git hash eb2c2b94 "CarpetIOASCII: adapt to gdata::copy_from being static" of [carpet](https://bitbucket.org/eschnett/carpet and git hash 6537e215 "CarpetLib: make gdata transfer functions static functions" of carpet. Before those Carpet/CarpetLib would use a NULL pointer to call (non-virtual) member functions that it “knew” would not actually access member variables due to arguments in the call. This was never quite legal (this must not be NULL and must always (even in the constructor) point to a valid region of memory).
Essentially the compiler is free to optimize things like:
foo::bar(int a) { if(a) return 0; int b = this->c; return ; }
to
foo::bar(int--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/177/exc_bad_access-in-carpetioascii