These asserts are not needed, here. tableIndex has already been dereferenced -- assert earlier to avoid the SEGV. And why would tableIndex not be equal to the expression you just assigned it from?