Problem: potential buffer-underflow with invalid hl_id (mugitya03)
Solution: assert that the return-code of syn_get_final_id() if > 0
As a safety check, syn_get_final_id() may return zero when either the
provided hl_id is zero or larger than expected.
However, many callers of syn_get_final_id() do not check that the return
value is larger than zero but re-use the returned highlight id directly
like this:
hl_id = syn_get_final_id(hl_id);
sgp = &HL_TABLE()[hl_id - 1]; // index is ID minus one
in which case, this would cause a buffer underrun and an access violation.
Let's use assert(hl_id > 0); to make sure that hl_id is larger than
zero.
Note to myself: I'll need to compile releases builds using -DNDEBUG once
a new release will be made
fixes: #17475closes: #17512
Signed-off-by: Christian Brabandt <cb@256bit.org>
When certain changes guarantee failure for old syntax tests,
opt for faster failure by reducing the number of screendumps
made for each file "page" to be no greater than the assigned
value of a VIM_SYNTAX_TEST_WAIT_TIME environment variable.
(This variable will be ignored and more screendumps may be
made when Make is GNU Make and a parent Makefile is used.)
Barring regressions, and assuming that v9.1.1163~1 succeeds
in providing a correct synchronisation mechanism outside of
"VerifyScreenDump()", and assuming that "readfile()" always
obtains the latest contents written by "term_dumpwrite()" in
"VerifyScreenDump()"; making a single screendump of a file
"page" and following it with a single reading of the written
screendump file should be enough to decide whether to pass
or fail a syntax test.
In addition, re-enable self testing after v9.1.1183~2.
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: the installer can be improved
Solution: update the installer with the correct README and LICENSE
files, improve the documentation, add a Makefile for the
installer, update the Makefiles (RestorerZ)
fixes: #16378closes: #16378
Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: cannot run single syntax tests
Solution: Support running a subset of syntax tests
(Aliaksei Budavei)
Two methods of assembling a subset of test filenames for
selection are provided:
* Filename and filetype Make targets will be generated, and
multiple such targets can be passed before the mandated
trailing "test" target, e.g. "make html markdown test".
* Filenames and their parts can be specified as a regular
expression that is assigned to a "VIM_SYNTAX_TEST_FILTER"
environment variable, and used with the test Make target,
e.g. "VIM_SYNTAX_TEST_FILTER=html\\\|markdown make test".
(This variable will be ignored and the whole suite will be
run when Make is GNU Make and a parent Makefile is used.)
Methods can be used alone or together, with the Make targets
having the higher precedence. Neither method will influence
the order of test execution.
closes: #15670
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: there are some Win9x legacy references
Solution: Remove those mentions (Nir Lichtman)
closes: #15730
Signed-off-by: Nir Lichtman <nir@lichtman.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: inconsistent parameter in Makefiles for Vim executable
Solution: consistently use $VIMPROG across all Makefiles
(RestorerZ)
closes: #15099
Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
* NSIS: Possibility to include translated license and README.txt files
* fixed a missing semicolon
* Disable always show dialog choice language
Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: runtime tests fail with tiny vim
Solution: check for tiny vim, run runtime tests in CI
even for tiny version
closes: #13169closes: #13170
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Dominique Pellé <dominique.pelle@tomtom.com>
Problem: "make clean" at the toplevel fails.
Solution: Clean the indent and syntax directories in a sub-shell. (Ben
Jackson, closes#12536, closes#12526)
Problem: The bitmaps/vim.ico file is not in the distribution.
Solution: Add it back to the distribution. Adjust the build rules to have
it end up in the right place.
Problem: "make clean" in top dir does not cleanup indent test output.
Solution: Clean the indent test output. Do not rely on the vim executable
for that. (closes#4307)
Problem: MS-Windows: missing 32 and 64 bit files in installer.
Solution: Include both 32 and 64 bit GvimExt and related dll files. Remove
old Windows code from the installer. (Ken Takata, closes#2144)
Problem: The tee program isn't included. Makefile contains build
instructions that don't work.
Solution: Update the Filelist and build instructions. Remove build
instructions for DOS and old Windows. Add the tee program.
Problem: The nsis script can't be used from the appveyor build.
Solution: Add "ifndef" to allow for variables to be set from the command
line. Remove duplicate SetCompressor command. Support using other
gettext binaries. (Ken Takata) Update build instructions to use
libintl-8.dll.
Problem: The distribution files for MS-Windows use CR-LF, which is
inconsistent with what one gets from github.
Solution: Use LF in the distribution files.
Problem: New GDK files and testdir/Make_all.mak missing from distribution.
PC build instructions are outdated.
Solution: Add the file to the list. Update PC build instructions.