Compare commits

...

6 Commits

Author SHA1 Message Date
Bram Moolenaar
f12519dec8 patch 8.0.1475: invalid memory access in read_redo()
Problem:    Invalid memory access in read_redo(). (gy741)
Solution:   Convert the replacement character back from a negative number to
            CR or NL. (hint by Dominique Pelle, closes #2616)
2018-02-06 22:52:49 +01:00
Bram Moolenaar
dd08b6a32b patch 8.0.1474: Visual C 2017 has multiple MSVCVER numbers
Problem:    Visual C 2017 has multiple MSVCVER numbers.
Solution:   Assume the 2017 version if MSVCVER >= 1910. (Leonardo Valeri
            Manera, closes #2619)
2018-02-06 22:02:43 +01:00
Bram Moolenaar
511ffdd65d patch 8.0.1473: MS-Windows: D&D fails between 32 and 64 bit apps
Problem:    MS-Windows: D&D fails between 32 and 64 bit apps.
Solution:   Add the /HIGHENTROPYVA:NO linker option. (Ken Takata, closes #2504)
2018-02-04 19:37:40 +01:00
Bram Moolenaar
5d4247402b patch 8.0.1472: MS-Windows: nsis installer is a bit slow
Problem:    MS-Windows: nsis installer is a bit slow.
Solution:   Use ReserveFile for vimrc.ini. (closes #2522)
2018-02-04 19:11:30 +01:00
Bram Moolenaar
28944fecff patch 8.0.1471: on MS-Windows CursorIM highlighting no longer works
Problem:    On MS-Windows CursorIM highlighting no longer works.
Solution:   Adjust #if statements. (Ken Takata)
2018-02-04 19:01:31 +01:00
Bram Moolenaar
2c7b906afb patch 8.0.1470: integer overflow when using regexp pattern
Problem:    Integer overflow when using regexp pattern. (geeknik)
Solution:   Use a long instead of int. (Christian Brabandt, closes #2251)
2018-02-04 18:22:46 +01:00
9 changed files with 90 additions and 30 deletions

View File

@@ -89,6 +89,11 @@ Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
# Reserve files
# Needed for showing the _vimrc setting page faster.
ReserveFile /plugin InstallOptions.dll
ReserveFile vimrc.ini
##########################################################
# Functions
@@ -475,14 +480,12 @@ Function SetCustom
# Display the InstallOptions dialog
# Check if a _vimrc should be created
SectionGetFlags ${sec_vimrc_id} $0
IntOp $0 $0 & 1
StrCmp $0 "1" +2 0
SectionGetFlags ${sec_vimrc_id} $3
IntOp $3 $3 & 1
StrCmp $3 "1" +2 0
Abort
Push $3
InstallOptions::dialog "$PLUGINSDIR\vimrc.ini"
Pop $3
InstallOptions::dialog "$PLUGINSDIR\vimrc.ini"
Pop $3
FunctionEnd

View File

@@ -289,7 +289,8 @@ MSVC_MAJOR = ($(MSVCVER) / 100 - 6)
MSVCRT_VER = ($(MSVCVER) / 10 - 60)
# Visual C++ 2017 needs special handling
# it has an _MSC_VER of 1910->14.1, but is actually v15 with runtime v140
!elseif $(MSVCVER) == 1910
# TODO: what's the maximum value?
!elseif $(MSVCVER) >= 1910
MSVC_MAJOR = 15
MSVCRT_VER = 140
!else
@@ -1179,6 +1180,13 @@ LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
!endif
!endif
!if $(MSVC_MAJOR) >= 11 && "$(CPU)" == "AMD64" && "$(GUI)" == "yes"
# This option is required for VC2012 or later so that 64-bit gvim can
# accept D&D from 32-bit applications. NOTE: This disables 64-bit ASLR,
# therefore the security level becomes as same as VC2010.
LINKARGS1 = $(LINKARGS1) /HIGHENTROPYVA:NO
!endif
all: $(VIM).exe \
vimrun.exe \
install.exe \

View File

@@ -1137,13 +1137,13 @@ gui_update_cursor(
if (id > 0)
{
cattr = syn_id2colors(id, &cfg, &cbg);
#if defined(FEAT_XIM) || defined(FEAT_HANGULIN)
#if defined(FEAT_MBYTE) || defined(FEAT_HANGULIN)
{
static int iid;
guicolor_T fg, bg;
if (
# if defined(FEAT_GUI_GTK) && !defined(FEAT_HANGULIN)
# if defined(FEAT_GUI_GTK) && defined(FEAT_XIM) && !defined(FEAT_HANGULIN)
preedit_get_status()
# else
im_get_status()

View File

@@ -1685,11 +1685,19 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
get_op_char(oap->op_type), get_extra_op_char(oap->op_type),
oap->motion_force, cap->cmdchar, cap->nchar);
else if (cap->cmdchar != ':')
{
int nchar = oap->op_type == OP_REPLACE ? cap->nchar : NUL;
/* reverse what nv_replace() did */
if (nchar == REPLACE_CR_NCHAR)
nchar = CAR;
else if (nchar == REPLACE_NL_NCHAR)
nchar = NL;
prep_redo(oap->regname, 0L, NUL, 'v',
get_op_char(oap->op_type),
get_extra_op_char(oap->op_type),
oap->op_type == OP_REPLACE
? cap->nchar : NUL);
nchar);
}
if (!redo_VIsual_busy)
{
redo_VIsual_mode = resel_VIsual_mode;
@@ -7023,10 +7031,12 @@ nv_replace(cmdarg_T *cap)
reset_VIsual();
if (had_ctrl_v)
{
if (cap->nchar == '\r')
cap->nchar = -1;
else if (cap->nchar == '\n')
cap->nchar = -2;
/* Use a special (negative) number to make a difference between a
* literal CR or NL and a line break. */
if (cap->nchar == CAR)
cap->nchar = REPLACE_CR_NCHAR;
else if (cap->nchar == NL)
cap->nchar = REPLACE_NL_NCHAR;
}
nv_operator(cap);
return;

View File

@@ -2113,13 +2113,21 @@ op_replace(oparg_T *oap, int c)
size_t oldlen;
struct block_def bd;
char_u *after_p = NULL;
int had_ctrl_v_cr = (c == -1 || c == -2);
int had_ctrl_v_cr = FALSE;
if ((curbuf->b_ml.ml_flags & ML_EMPTY ) || oap->empty)
return OK; /* nothing to do */
if (had_ctrl_v_cr)
c = (c == -1 ? '\r' : '\n');
if (c == REPLACE_CR_NCHAR)
{
had_ctrl_v_cr = TRUE;
c = CAR;
}
else if (c == REPLACE_NL_NCHAR)
{
had_ctrl_v_cr = TRUE;
c = NL;
}
#ifdef FEAT_MBYTE
if (has_mbyte)
@@ -2207,7 +2215,8 @@ op_replace(oparg_T *oap, int c)
/* insert pre-spaces */
vim_memset(newp + bd.textcol, ' ', (size_t)bd.startspaces);
/* insert replacement chars CHECK FOR ALLOCATED SPACE */
/* -1/-2 is used for entering CR literally. */
/* REPLACE_CR_NCHAR/REPLACE_NL_NCHAR is used for entering CR
* literally. */
if (had_ctrl_v_cr || (c != '\r' && c != '\n'))
{
#ifdef FEAT_MBYTE
@@ -6370,7 +6379,7 @@ write_viminfo_registers(FILE *fp)
* |{bartype},{flags},{name},{type},
* {linecount},{width},{timestamp},"line1","line2"
* flags: REG_PREVIOUS - register is y_previous
* REG_EXEC - used for @@
* REG_EXEC - used for @@
*/
if (y_previous == &y_regs[i])
flags |= REG_PREVIOUS;

View File

@@ -1600,7 +1600,7 @@ nfa_regatom(void)
default:
{
int n = 0;
long n = 0;
int cmp = c;
if (c == '<' || c == '>')
@@ -1628,7 +1628,14 @@ nfa_regatom(void)
/* \%{n}v \%{n}<v \%{n}>v */
EMIT(cmp == '<' ? NFA_VCOL_LT :
cmp == '>' ? NFA_VCOL_GT : NFA_VCOL);
EMIT(n);
#if VIM_SIZEOF_INT < VIM_SIZEOF_LONG
if (n > INT_MAX)
{
EMSG(_("E951: \\% value too large"));
return FAIL;
}
#endif
EMIT((int)n);
break;
}
else if (c == '\'' && n == 0)
@@ -3970,7 +3977,7 @@ static int nfa_match;
#ifdef FEAT_RELTIME
static proftime_T *nfa_time_limit;
static int *nfa_timed_out;
static int nfa_time_count;
static int nfa_time_count;
#endif
static void copy_pim(nfa_pim_T *to, nfa_pim_T *from);
@@ -4068,10 +4075,10 @@ copy_ze_off(regsub_T *to, regsub_T *from)
if (REG_MULTI)
{
if (from->list.multi[0].end_lnum >= 0)
{
{
to->list.multi[0].end_lnum = from->list.multi[0].end_lnum;
to->list.multi[0].end_col = from->list.multi[0].end_col;
}
}
}
else
{
@@ -5124,9 +5131,9 @@ recursive_regmatch(
}
if (state->c == NFA_START_INVISIBLE_BEFORE
|| state->c == NFA_START_INVISIBLE_BEFORE_FIRST
|| state->c == NFA_START_INVISIBLE_BEFORE_NEG
|| state->c == NFA_START_INVISIBLE_BEFORE_NEG_FIRST)
|| state->c == NFA_START_INVISIBLE_BEFORE_FIRST
|| state->c == NFA_START_INVISIBLE_BEFORE_NEG
|| state->c == NFA_START_INVISIBLE_BEFORE_NEG_FIRST)
{
/* The recursive match must end at the current position. When "pim" is
* not NULL it specifies the current position. */
@@ -6302,7 +6309,7 @@ nfa_regmatch(
}
}
else if (state->c < 0 ? check_char_class(state->c, curc)
: (curc == state->c
: (curc == state->c
|| (rex.reg_ic && MB_TOLOWER(curc)
== MB_TOLOWER(state->c))))
{
@@ -6863,7 +6870,7 @@ nfa_regmatch(
&& (REG_MULTI
? (reglnum < nfa_endp->se_u.pos.lnum
|| (reglnum == nfa_endp->se_u.pos.lnum
&& (int)(reginput - regline)
&& (int)(reginput - regline)
< nfa_endp->se_u.pos.col))
: reginput < nfa_endp->se_u.ptr))))
{

View File

@@ -403,3 +403,10 @@ func Test_undo_0()
bwipe!
endfunc
func Test_redo_empty_line()
new
exe "norm\x16r\x160"
exe "norm."
bwipe!
endfunc

View File

@@ -771,6 +771,18 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1475,
/**/
1474,
/**/
1473,
/**/
1472,
/**/
1471,
/**/
1470,
/**/
1469,
/**/

View File

@@ -2515,4 +2515,8 @@ typedef enum {
# endif
#endif
/* Replacement for nchar used by nv_replace(). */
#define REPLACE_CR_NCHAR -1
#define REPLACE_NL_NCHAR -2
#endif /* VIM__H */