You are looking at an old version of the code. The hard fork that you are warning of has already happened in the past. This is what the code looks like now:
{
int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;
// Force block reward to zero when right shift is undefined.
if (halvings >= 64)
return 0;
CAmount nSubsidy = 50 * COIN;
// Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
nSubsidy >>= halvings;
return nSubsidy;
}
That means that we could have a problem every 350,725,227,654,375 years (assuming that we are still using 64 bit computers at that time and that Bitcoin still exists).
For all intents and purposes, we can say that there is a finite supply of less than 21 million.
Thanks Danny. Apparently the code was indeed fixed.
https://github.com/bitcoin/bitcoin/pull/3842
Probably makes sense to lock this thread now. Sorry for the confusion.