aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-05-31 13:53:15 -0400
committerJustin M. Keyes <justinkz@gmail.com>2014-05-31 13:53:15 -0400
commita2e9580801e89f8fa6e1e3f0ccb3d4a740d7ac03 (patch)
treece480b89d13ba6927ac9beae5039bb3c214fee80 /src
parent7e797067df8d120fcbfcb4986f58ab5bb662fadf (diff)
parentc0fae8b9228bf51c85f37abd3873d81384f11a53 (diff)
downloadrneovim-a2e9580801e89f8fa6e1e3f0ccb3d4a740d7ac03.tar.gz
rneovim-a2e9580801e89f8fa6e1e3f0ccb3d4a740d7ac03.tar.bz2
rneovim-a2e9580801e89f8fa6e1e3f0ccb3d4a740d7ac03.zip
Merge #714 'Fix unused variable when NDEBUG is defined'
Diffstat (limited to 'src')
-rw-r--r--src/nvim/os/rstream.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nvim/os/rstream.c b/src/nvim/os/rstream.c
index b1e4cc7a57..4e6fc55d3b 100644
--- a/src/nvim/os/rstream.c
+++ b/src/nvim/os/rstream.c
@@ -11,6 +11,8 @@
#include "nvim/os/event.h"
#include "nvim/vim.h"
#include "nvim/memory.h"
+#include "nvim/log.h"
+#include "nvim/misc1.h"
struct rstream {
uv_buf_t uvbuf;
@@ -240,7 +242,10 @@ static void fread_idle_cb(uv_idle_t *handle)
// to read more than 9 quintillion (9e18) bytes?
// upcast is meant to avoid tautological condition warning on 32 bits
uintmax_t fpos_intmax = rstream->fpos;
- assert(fpos_intmax <= INT64_MAX);
+ if (fpos_intmax > INT64_MAX) {
+ ELOG("stream offset overflow");
+ preserve_exit();
+ }
// Synchronous read
uv_fs_read(