generates correct flat index addresses for char/bool arrays