aboutsummaryrefslogtreecommitdiffstats
path: root/fastlib
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2019-08-02 11:39:41 +0200
committerTor Egge <Tor.Egge@broadpark.no>2019-08-02 11:39:41 +0200
commitf45ddb4d2fd8908c20869cb7006848d99cf72bf9 (patch)
tree632920febb60198558b388501445ae248185b93f /fastlib
parent23cfe895f2ac02305e68368e7f204eb4ad9944d1 (diff)
Use abort in Fast_BufferedFile::SetPosition.
Diffstat (limited to 'fastlib')
-rw-r--r--fastlib/src/vespa/fastlib/io/bufferedfile.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/fastlib/src/vespa/fastlib/io/bufferedfile.cpp b/fastlib/src/vespa/fastlib/io/bufferedfile.cpp
index 9af2a73a31b..bd1dd729e39 100644
--- a/fastlib/src/vespa/fastlib/io/bufferedfile.cpp
+++ b/fastlib/src/vespa/fastlib/io/bufferedfile.cpp
@@ -171,7 +171,7 @@ Fast_BufferedFile::SetPosition(const int64_t s)
if ((diff <= 0l) || (diff > (_bufe - buf()))) {
const int64_t newPos(s & ~(_buf.size() - 1l) );
if ((s - newPos) >= static_cast<int64_t>(_buf.size())) {
- *static_cast<int *>(0) = 1;
+ abort();
}
int64_t oldPos(_filepos);
int64_t oldLeft(_fileleft);
@@ -181,19 +181,19 @@ Fast_BufferedFile::SetPosition(const int64_t s)
fillReadBuf();
if ((oldLeft == _fileleft) && (_fileleft != 0l)) {
- *static_cast<int *>(0) = 2;
+ abort();
}
if ((_filepos == oldPos) && (_fileleft != 0l)) {
- *static_cast<int *>(0) = 3;
+ abort();
}
if ((_filepos < s) || ((_filepos == s) && (_fileleft != 0))) {
- *static_cast<int *>(0) = 4;
+ abort();
}
diff = _filepos - s;
if ( !(((diff > 0l) || ((diff == 0l) && (_fileleft == 0l))) && (diff <= static_cast<int64_t>(_buf.size())))) {
char tmp[8196];
sprintf(tmp, "diff %" PRId64 " _fileleft=%" PRId64 " _buflen=%zu", diff, _fileleft, _buf.size());
- *static_cast<int *>(0) = 5;
+ abort();
}
}
_bufi = _bufe - diff;