Mercurial > vim
view runtime/macros/maze/maze.c @ 18945:c62d63d2b9f0 v8.2.0033
patch 8.2.0033: crash when make_extmatch() runs out of memory
Commit: https://github.com/vim/vim/commit/7c77b3496710f1be3232cfdc7f6812347fbd914a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Dec 22 19:40:40 2019 +0100
patch 8.2.0033: crash when make_extmatch() runs out of memory
Problem: Crash when make_extmatch() runs out of memory.
Solution: Check for NULL. (Dominique Pelle, closs https://github.com/vim/vim/issues/5392)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 22 Dec 2019 19:45:03 +0100 |
parents | 3fc0f57ecb91 |
children |
line wrap: on
line source
char*M,A,Z,E=40,J[40],T[40];main(C){for(*J=A=scanf(M="%d",&C); -- E; J[ E] =T [E ]= E) printf("._"); for(;(A-=Z=!Z) || (printf("\n|" ) , A = 39 ,C -- ) ; Z || printf (M ))M[Z]=Z[A-(E =A[J-Z])&&!C & A == T[ A] |6<<27<rand()||!C&!Z?J[T[E]=T[A]]=E,J[T[A]=A-Z]=A,"_.":" |"];}