summaryrefslogtreecommitdiffstats
path: root/src/evalfunc.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-02-22 19:48:06 +0100
committerChristian Brabandt <cb@256bit.org>2024-02-22 19:48:06 +0100
commit421b597470c118871c7081de00dd065e0e000b7e (patch)
tree468685895448cd96be6befa3e1df9cda1ed72a3d /src/evalfunc.c
parent1624970d321cfb637ac76232df9c9b3f2fae904c (diff)
patch 9.1.0126: Internal error when using upper-case mark in getregion()v9.1.0126
Problem: Internal error when passing mark in another buffer to getregion(). Solution: Don't allow marks in another buffer (zeertzjq) closes: #14076 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Internal error when passing mark in another buffer to getregion()
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r--src/evalfunc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 071bf7d0f8..981f8abedf 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -5508,12 +5508,12 @@ f_getregion(typval_T *argvars, typval_T *rettv)
// NOTE: var2fpos() returns static pointer.
fp = var2fpos(&argvars[0], TRUE, &fnum, FALSE);
- if (fp == NULL)
+ if (fp == NULL || (fnum >= 0 && fnum != curbuf->b_fnum))
return;
p1 = *fp;
fp = var2fpos(&argvars[1], TRUE, &fnum, FALSE);
- if (fp == NULL)
+ if (fp == NULL || (fnum >= 0 && fnum != curbuf->b_fnum))
return;
p2 = *fp;