Mercurial > vim
comparison src/structs.h @ 29340:fba9e366ced4 v9.0.0013
patch 9.0.0013: reproducing memory access errors can be difficult
Commit: https://github.com/vim/vim/commit/fa4873ccfc10e0f278dc46f39d00136fab059b19
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jun 30 22:13:59 2022 +0100
patch 9.0.0013: reproducing memory access errors can be difficult
Problem: Reproducing memory access errors can be difficult.
Solution: When testing, copy each line to allocated memory, so that valgrind
can detect accessing memory before and/or after it. Fix uncovered
problems.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 30 Jun 2022 23:15:03 +0200 |
parents | ff98d9c228d4 |
children | 9dce192d1ac2 |
comparison
equal
deleted
inserted
replaced
29339:a023e3008ae3 | 29340:fba9e366ced4 |
---|---|
754 | 754 |
755 infoptr_T *ml_stack; // stack of pointer blocks (array of IPTRs) | 755 infoptr_T *ml_stack; // stack of pointer blocks (array of IPTRs) |
756 int ml_stack_top; // current top of ml_stack | 756 int ml_stack_top; // current top of ml_stack |
757 int ml_stack_size; // total number of entries in ml_stack | 757 int ml_stack_size; // total number of entries in ml_stack |
758 | 758 |
759 #define ML_EMPTY 1 // empty buffer | 759 #define ML_EMPTY 0x01 // empty buffer |
760 #define ML_LINE_DIRTY 2 // cached line was changed and allocated | 760 #define ML_LINE_DIRTY 0x02 // cached line was changed and allocated |
761 #define ML_LOCKED_DIRTY 4 // ml_locked was changed | 761 #define ML_LOCKED_DIRTY 0x04 // ml_locked was changed |
762 #define ML_LOCKED_POS 8 // ml_locked needs positive block number | 762 #define ML_LOCKED_POS 0x08 // ml_locked needs positive block number |
763 #define ML_ALLOCATED 0x10 // ml_line_ptr is an allocated copy | |
763 int ml_flags; | 764 int ml_flags; |
764 | 765 |
765 colnr_T ml_line_len; // length of the cached line, including NUL | 766 colnr_T ml_line_len; // length of the cached line, including NUL |
766 linenr_T ml_line_lnum; // line number of cached line, 0 if not valid | 767 linenr_T ml_line_lnum; // line number of cached line, 0 if not valid |
767 char_u *ml_line_ptr; // pointer to cached line | 768 char_u *ml_line_ptr; // pointer to cached line |