annotate runtime/tools/efm_filter.pl @ 17907:4cf69f8d1ec6 v8.1.1950

patch 8.1.1950: using NULL pointer after an out-of-memory Commit: https://github.com/vim/vim/commit/4bbfb0f3cc67c00c8cee4e47283e8d760025219d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 31 15:28:02 2019 +0200 patch 8.1.1950: using NULL pointer after an out-of-memory Problem: Using NULL pointer after an out-of-memory. Solution: Check for NULL pointer. (Dominique Pelle, closes https://github.com/vim/vim/issues/4881)
author Bram Moolenaar <Bram@vim.org>
date Sat, 31 Aug 2019 15:30:04 +0200
parents 3fc0f57ecb91
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 #!/usr/bin/env perl
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 # This program works as a filter that reads from stdin, copies to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 # stdout *and* creates an error file that can be read by vim.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 # This program has only been tested on SGI, Irix5.3.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 # Written by Ives Aerts in 1996. This little program is not guaranteed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 # to do (or not do) anything at all and can be freely used for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 # whatever purpose you can think of.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 $args = @ARGV;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 unless ($args == 1) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 die("Usage: vimccparse <output filename>\n");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 $filename = @ARGV[0];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 open (OUT, ">$filename") || die ("Can't open file: \"$filename\"");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 while (<STDIN>) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 print;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 if ( (/"(.*)", line (\d+): (e)rror\((\d+)\):/)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 || (/"(.*)", line (\d+): (w)arning\((\d+)\):/) ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 $file=$1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 $line=$2;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 $errortype="\u$3";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 $errornr=$4;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 chop($errormsg=<STDIN>);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 $errormsg =~ s/^\s*//;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 $sourceline=<STDIN>;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 $column=index(<STDIN>, "^") - 1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 print OUT "$file>$line:$column:$errortype:$errornr:$errormsg\n";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 close(OUT);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 exit(0);