From dd6c1a0a8f14aed30816aae6a354f2056bfbf15f Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 10 Aug 2018 09:33:48 -0400 Subject: vim-patch:8.0.0828: Coverity: may dereference NULL pointer Problem: Coverity: may dereference NULL pointer. Solution: Bail out if calloc_state() returns NULL. https://github.com/vim/vim/commit/983b3a5bc44a91cc7e40b8e71e3bfdb03dd4606f --- src/nvim/regexp_nfa.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index deef3042d2..dcd89d1470 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -3224,7 +3224,13 @@ static nfa_state_T *post2nfa(int *postfix, int *end, int nfa_calc_size) if (pattern) { /* NFA_ZEND -> NFA_END_PATTERN -> NFA_SKIP -> what follows. */ skip = alloc_state(NFA_SKIP, NULL, NULL); + if (skip == NULL) { + goto theend; + } zend = alloc_state(NFA_ZEND, s1, NULL); + if (zend == NULL) { + goto theend; + } s1->out= skip; patch(e.out, zend); PUSH(frag(s, list1(&skip->out))); -- cgit From f7f65f5a82346a18c3ddf7143d64e8ce3ad399e2 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 10 Aug 2018 09:42:07 -0400 Subject: vim-patch:8.0.1254: undefined left shift in gethexchrs() Problem: Undefined left shift in gethexchrs(). (geeknik) Solution: Use unsigned long. (idea by Christian Brabandt, closes vim/vim#2255) https://github.com/vim/vim/commit/4c22a91d20cce4f28dd2852a13129b5a4cc691da --- src/nvim/regexp.c | 19 +++++++++---------- src/nvim/regexp_nfa.c | 4 ++-- 2 files changed, 11 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index be6c43493b..9bfc158763 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -1664,9 +1664,8 @@ static char_u *regpiece(int *flagp) case Magic('@'): { int lop = END; - int nr; + int64_t nr = getdecchrs(); - nr = getdecchrs(); switch (no_Magic(getchr())) { case '=': lop = MATCH; break; /* \@= */ case '!': lop = NOMATCH; break; /* \@! */ @@ -2087,7 +2086,7 @@ static char_u *regatom(int *flagp) case 'u': /* %uabcd hex 4 */ case 'U': /* %U1234abcd hex 8 */ { - int i; + int64_t i; switch (c) { case 'd': i = getdecchrs(); break; @@ -2976,9 +2975,9 @@ static void ungetchr(void) * The parameter controls the maximum number of input characters. This will be * 2 when reading a \%x20 sequence and 4 when reading a \%u20AC sequence. */ -static int gethexchrs(int maxinputlen) +static int64_t gethexchrs(int maxinputlen) { - int nr = 0; + int64_t nr = 0; int c; int i; @@ -3000,9 +2999,9 @@ static int gethexchrs(int maxinputlen) * Get and return the value of the decimal string immediately after the * current position. Return -1 for invalid. Consumes all digits. */ -static int getdecchrs(void) +static int64_t getdecchrs(void) { - int nr = 0; + int64_t nr = 0; int c; int i; @@ -3029,9 +3028,9 @@ static int getdecchrs(void) * blahblah\%o210asdf * before-^ ^-after */ -static int getoctchrs(void) +static int64_t getoctchrs(void) { - int nr = 0; + int64_t nr = 0; int c; int i; @@ -3055,7 +3054,7 @@ static int getoctchrs(void) */ static int coll_get_char(void) { - int nr = -1; + int64_t nr = -1; switch (*regparse++) { case 'd': nr = getdecchrs(); break; diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index dcd89d1470..ac811ec8f4 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -1409,7 +1409,7 @@ static int nfa_regatom(void) case 'u': /* %uabcd hex 4 */ case 'U': /* %U1234abcd hex 8 */ { - int nr; + int64_t nr; switch (c) { case 'd': nr = getdecchrs(); break; @@ -1859,7 +1859,7 @@ static int nfa_regpiece(void) int greedy = TRUE; /* Braces are prefixed with '-' ? */ parse_state_T old_state; parse_state_T new_state; - int c2; + int64_t c2; int old_post_pos; int my_post_start; int quest; -- cgit From 5ed303c22b52ac1edc438b6e2edc44df1684974d Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 10 Aug 2018 10:25:02 -0400 Subject: vim-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 vim/vim#2251) https://github.com/vim/vim/commit/2c7b906afb86b986476cfc959732e433b1b4a3b1 --- src/nvim/regexp_nfa.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index ac811ec8f4..c5d46fcbbf 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -1485,7 +1485,7 @@ static int nfa_regatom(void) default: { - int n = 0; + long n = 0; int cmp = c; if (c == '<' || c == '>') @@ -1511,7 +1511,13 @@ static int nfa_regatom(void) EMIT(cmp == '<' ? NFA_VCOL_LT : cmp == '>' ? NFA_VCOL_GT : NFA_VCOL); } - EMIT(n); +#if SIZEOF_INT < SIZEOF_LONG + if (n > INT_MAX) { + EMSG(_("E951: \\% value too large")); + return FAIL; + } +#endif + EMIT((int)n); break; } else if (c == '\'' && n == 0) { /* \%'m \%<'m \%>'m */ -- cgit From cb708d203b36fff16b6f01a81c30ca20b51c82fc Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 10 Aug 2018 10:41:26 -0400 Subject: vim-patch:8.0.1517: invalid memory acces with pattern using look-behind match Problem: Invalid memory acces with pattern using look-behind match. (Dominique Pelle) Solution: Get a pointer to the right line. https://github.com/vim/vim/commit/bc197195b097707d08fd44a476dbc374366504cb --- src/nvim/regexp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 9bfc158763..9d16ecb46c 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -4922,8 +4922,11 @@ regmatch ( } } else { if (has_mbyte) { + const char_u *const line = + reg_getline(behind_pos.rs_u.pos.lnum); + rp->rs_un.regsave.rs_u.pos.col -= - (*mb_head_off)(regline, regline + (*mb_head_off)(line, line + rp->rs_un.regsave.rs_u.pos.col - 1) + 1; } else { rp->rs_un.regsave.rs_u.pos.col--; -- cgit From b3ad509905df03c81d128e395db5231434f68367 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 11 Aug 2018 07:45:02 -0400 Subject: vim-patch:8.1.0078: "..." used inconsistently in messages Problem: "..." used inconsistently in messages. Solution: Drop the space before " ...". https://github.com/vim/vim/commit/c166927a32fe5c054ad35deecff00aa12c629cf7 --- src/nvim/regexp_nfa.c | 2 +- src/nvim/spellfile.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index c5d46fcbbf..5f5e1323ab 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -4698,7 +4698,7 @@ static int recursive_regmatch(nfa_state_T *state, nfa_pim_T *pim, nfa_regprog_T fprintf(log_fd, "****************************\n"); } else { EMSG(_( - "Could not open temporary log file for writing, displaying on stderr ... ")); + "Could not open temporary log file for writing, displaying on stderr... ")); log_fd = stderr; } #endif diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c index 87fe73f692..ecf3a52fd3 100644 --- a/src/nvim/spellfile.c +++ b/src/nvim/spellfile.c @@ -1993,7 +1993,7 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname) return NULL; } - vim_snprintf((char *)IObuff, IOSIZE, _("Reading affix file %s ..."), fname); + vim_snprintf((char *)IObuff, IOSIZE, _("Reading affix file %s..."), fname); spell_message(spin, IObuff); // Only do REP lines when not done in another .aff file already. @@ -3032,7 +3032,7 @@ static int spell_read_dic(spellinfo_T *spin, char_u *fname, afffile_T *affile) hash_init(&ht); vim_snprintf((char *)IObuff, IOSIZE, - _("Reading dictionary file %s ..."), fname); + _("Reading dictionary file %s..."), fname); spell_message(spin, IObuff); // start with a message for the first line @@ -3548,7 +3548,7 @@ static int spell_read_wordfile(spellinfo_T *spin, char_u *fname) return FAIL; } - vim_snprintf((char *)IObuff, IOSIZE, _("Reading word file %s ..."), fname); + vim_snprintf((char *)IObuff, IOSIZE, _("Reading word file %s..."), fname); spell_message(spin, IObuff); // Read all the lines in the file one by one. @@ -4998,7 +4998,7 @@ static void sug_write(spellinfo_T *spin, char_u *fname) } vim_snprintf((char *)IObuff, IOSIZE, - _("Writing suggestion file %s ..."), fname); + _("Writing suggestion file %s..."), fname); spell_message(spin, IObuff); // : @@ -5234,7 +5234,7 @@ mkspell ( if (!error && !got_int) { // Write the info in the spell file. vim_snprintf((char *)IObuff, IOSIZE, - _("Writing spell file %s ..."), wfname); + _("Writing spell file %s..."), wfname); spell_message(&spin, IObuff); error = write_vim_spell(&spin, wfname) == FAIL; -- cgit From 96dc8c0d28da90445875d4ecfa8c057e2994cb7f Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 11 Aug 2018 07:53:24 -0400 Subject: vim-patch:8.1.0090: "..." used inconsistently in a message Problem: "..." used inconsistently in a message. Solution: Define the message with " ..." once. (hint by Ken Takata) https://github.com/vim/vim/commit/9b0c5c23bd5260caef82a4f3dcc945c129857c52 --- src/nvim/regexp_nfa.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index 5f5e1323ab..9b1a37a4ff 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -2453,6 +2453,7 @@ static void nfa_set_code(int c) } static FILE *log_fd; +static char_u e_log_open_failed[] = N_("Could not open temporary log file for writing, displaying on stderr... "); /* * Print the postfix notation of the current regexp. @@ -2466,7 +2467,7 @@ static void nfa_postfix_dump(char_u *expr, int retval) if (f != NULL) { fprintf(f, "\n-------------------------\n"); if (retval == FAIL) - fprintf(f, ">>> NFA engine failed ... \n"); + fprintf(f, ">>> NFA engine failed... \n"); else if (retval == OK) fprintf(f, ">>> NFA engine succeeded !\n"); fprintf(f, "Regexp: \"%s\"\nPostfix notation (char): \"", expr); @@ -4697,8 +4698,7 @@ static int recursive_regmatch(nfa_state_T *state, nfa_pim_T *pim, nfa_regprog_T fprintf(log_fd, "MATCH = %s\n", !result ? "FALSE" : "OK"); fprintf(log_fd, "****************************\n"); } else { - EMSG(_( - "Could not open temporary log file for writing, displaying on stderr... ")); + EMSG(_(e_log_open_failed)); log_fd = stderr; } #endif @@ -5002,8 +5002,7 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, abs(start->id), code); fprintf(log_fd, "**********************************\n"); } else { - EMSG(_( - "Could not open temporary log file for writing, displaying on stderr ... ")); + EMSG(_(e_log_open_failed)); log_fd = stderr; } #endif @@ -5068,7 +5067,7 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, fprintf(log_fd, "------------------------------------------\n"); fprintf(log_fd, ">>> Reginput is \"%s\"\n", reginput); fprintf(log_fd, - ">>> Advanced one character ... Current char is %c (code %d) \n", curc, + ">>> Advanced one character... Current char is %c (code %d) \n", curc, (int)curc); fprintf(log_fd, ">>> Thislist has %d states available: ", thislist->n); { @@ -5108,7 +5107,7 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, else col = (int)(t->subs.norm.list.line[0].start - regline); nfa_set_code(t->state->c); - fprintf(log_fd, "(%d) char %d %s (start col %d)%s ... \n", + fprintf(log_fd, "(%d) char %d %s (start col %d)%s... \n", abs(t->state->id), (int)t->state->c, code, col, pim_info(&t->pim)); } @@ -6493,7 +6492,7 @@ static regprog_T *nfa_regcomp(char_u *expr, int re_flags) if (f != NULL) { fprintf( f, - "\n*****************************\n\n\n\n\tCompiling regexp \"%s\" ... hold on !\n", + "\n*****************************\n\n\n\n\tCompiling regexp \"%s\"... hold on !\n", expr); fclose(f); } -- cgit From 9c4f6307b75aa3a4702a3bc65880d0e6c91b82a1 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 11 Aug 2018 07:58:49 -0400 Subject: vim-patch:8.1.0097: superfluous space before exclamation mark Problem: Superfluous space before exclamation mark. Solution: Remove the space. Don't translate debug message. https://github.com/vim/vim/commit/5efa0102de6ed6049fb19e1e83787e5b3b24b6a2 --- src/nvim/regexp_nfa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index 9b1a37a4ff..2c927585bf 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -2723,7 +2723,7 @@ static void st_error(int *postfix, int *end, int *p) fclose(df); } #endif - EMSG(_("E874: (NFA) Could not pop the stack !")); + EMSG(_("E874: (NFA) Could not pop the stack!")); } /* @@ -4964,7 +4964,7 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, FILE *debug = fopen(NFA_REGEXP_DEBUG_LOG, "a"); if (debug == NULL) { - EMSG2(_("(NFA) COULD NOT OPEN %s !"), NFA_REGEXP_DEBUG_LOG); + EMSG2("(NFA) COULD NOT OPEN %s!", NFA_REGEXP_DEBUG_LOG); return false; } #endif -- cgit From 5f4a231e3f239f02aff485ed8b4776c7481c4823 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 11 Aug 2018 08:01:29 -0400 Subject: vim-patch:8.1.0099: exclamation mark in error message not needed Problem: Exclamation mark in error message not needed. Solution: Remove the exclamation mark. https://github.com/vim/vim/commit/3c867daaf09e8ac6ce4b9d43d6fbbfdd7689702d --- src/nvim/regexp_nfa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index 2c927585bf..95dc17f57f 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -2040,7 +2040,7 @@ static int nfa_regpiece(void) if (re_multi_type(peekchr()) != NOT_MULTI) /* Can't have a multi follow a multi. */ - EMSG_RET_FAIL(_("E871: (NFA regexp) Can't have a multi follow a multi !")); + EMSG_RET_FAIL(_("E871: (NFA regexp) Can't have a multi follow a multi")); return OK; } @@ -6264,7 +6264,7 @@ static long nfa_regtry(nfa_regprog_T *prog, colnr_T col, proftime_T *tm) fprintf(f, "\n\n"); fclose(f); } else - EMSG(_("Could not open temporary log file for writing ")); + EMSG("Could not open temporary log file for writing"); #endif clear_sub(&subs.norm); -- cgit From d624aea454e7873e3ab94db313dcacdb251490f0 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 11 Aug 2018 14:32:56 -0400 Subject: lint --- src/nvim/regexp_nfa.c | 40 +++++++++++++++++++++++----------------- src/nvim/spellfile.c | 6 +++--- 2 files changed, 26 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index 95dc17f57f..3b905f5efc 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -2038,9 +2038,10 @@ static int nfa_regpiece(void) break; } /* end switch */ - if (re_multi_type(peekchr()) != NOT_MULTI) - /* Can't have a multi follow a multi. */ + if (re_multi_type(peekchr()) != NOT_MULTI) { + // Can't have a multi follow a multi. EMSG_RET_FAIL(_("E871: (NFA regexp) Can't have a multi follow a multi")); + } return OK; } @@ -2453,7 +2454,8 @@ static void nfa_set_code(int c) } static FILE *log_fd; -static char_u e_log_open_failed[] = N_("Could not open temporary log file for writing, displaying on stderr... "); +static char_u e_log_open_failed[] = N_( + "Could not open temporary log file for writing, displaying on stderr... "); /* * Print the postfix notation of the current regexp. @@ -2466,10 +2468,11 @@ static void nfa_postfix_dump(char_u *expr, int retval) f = fopen(NFA_REGEXP_DUMP_LOG, "a"); if (f != NULL) { fprintf(f, "\n-------------------------\n"); - if (retval == FAIL) + if (retval == FAIL) { fprintf(f, ">>> NFA engine failed... \n"); - else if (retval == OK) + } else if (retval == OK) { fprintf(f, ">>> NFA engine succeeded !\n"); + } fprintf(f, "Regexp: \"%s\"\nPostfix notation (char): \"", expr); for (p = post_start; *p && p < post_ptr; p++) { nfa_set_code(*p); @@ -5067,8 +5070,9 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, fprintf(log_fd, "------------------------------------------\n"); fprintf(log_fd, ">>> Reginput is \"%s\"\n", reginput); fprintf(log_fd, - ">>> Advanced one character... Current char is %c (code %d) \n", curc, - (int)curc); + ">>> Advanced one character... Current char is %c (code %d) \n", + curc, + (int)curc); fprintf(log_fd, ">>> Thislist has %d states available: ", thislist->n); { int i; @@ -5100,16 +5104,17 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, { int col; - if (t->subs.norm.in_use <= 0) + if (t->subs.norm.in_use <= 0) { col = -1; - else if (REG_MULTI) + } else if (REG_MULTI) { col = t->subs.norm.list.multi[0].start_col; - else + } else { col = (int)(t->subs.norm.list.line[0].start - regline); + } nfa_set_code(t->state->c); fprintf(log_fd, "(%d) char %d %s (start col %d)%s... \n", - abs(t->state->id), (int)t->state->c, code, col, - pim_info(&t->pim)); + abs(t->state->id), (int)t->state->c, code, col, + pim_info(&t->pim)); } #endif @@ -6263,8 +6268,9 @@ static long nfa_regtry(nfa_regprog_T *prog, colnr_T col, proftime_T *tm) nfa_print_state(f, start); fprintf(f, "\n\n"); fclose(f); - } else + } else { EMSG("Could not open temporary log file for writing"); + } #endif clear_sub(&subs.norm); @@ -6490,10 +6496,10 @@ static regprog_T *nfa_regcomp(char_u *expr, int re_flags) FILE *f = fopen(NFA_REGEXP_RUN_LOG, "a"); if (f != NULL) { - fprintf( - f, - "\n*****************************\n\n\n\n\tCompiling regexp \"%s\"... hold on !\n", - expr); + fprintf(f, + "\n*****************************\n\n\n\n\t" + "Compiling regexp \"%s\"... hold on !\n", + expr); fclose(f); } } diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c index ecf3a52fd3..b8774bd680 100644 --- a/src/nvim/spellfile.c +++ b/src/nvim/spellfile.c @@ -3032,7 +3032,7 @@ static int spell_read_dic(spellinfo_T *spin, char_u *fname, afffile_T *affile) hash_init(&ht); vim_snprintf((char *)IObuff, IOSIZE, - _("Reading dictionary file %s..."), fname); + _("Reading dictionary file %s..."), fname); spell_message(spin, IObuff); // start with a message for the first line @@ -4998,7 +4998,7 @@ static void sug_write(spellinfo_T *spin, char_u *fname) } vim_snprintf((char *)IObuff, IOSIZE, - _("Writing suggestion file %s..."), fname); + _("Writing suggestion file %s..."), fname); spell_message(spin, IObuff); // : @@ -5234,7 +5234,7 @@ mkspell ( if (!error && !got_int) { // Write the info in the spell file. vim_snprintf((char *)IObuff, IOSIZE, - _("Writing spell file %s..."), wfname); + _("Writing spell file %s..."), wfname); spell_message(&spin, IObuff); error = write_vim_spell(&spin, wfname) == FAIL; -- cgit From d6a25f89b8d664fa2a42f730e78e780fb611b0b9 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 11 Aug 2018 17:45:17 -0400 Subject: regexp: drop has_mbyte check in regmatch() has_mbyte is always true in nvim. --- src/nvim/regexp.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 9d16ecb46c..98d737c9a9 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -4921,16 +4921,13 @@ regmatch ( (colnr_T)STRLEN(regline); } } else { - if (has_mbyte) { - const char_u *const line = - reg_getline(behind_pos.rs_u.pos.lnum); + const char_u *const line = + reg_getline(behind_pos.rs_u.pos.lnum); - rp->rs_un.regsave.rs_u.pos.col -= - (*mb_head_off)(line, line - + rp->rs_un.regsave.rs_u.pos.col - 1) + 1; - } else { - rp->rs_un.regsave.rs_u.pos.col--; - } + rp->rs_un.regsave.rs_u.pos.col -= + utf_head_off(line, + line + rp->rs_un.regsave.rs_u.pos.col - 1) + + 1; } } else { if (rp->rs_un.regsave.rs_u.ptr == regline) { -- cgit