]> git.eshelyaron.com Git - emacs.git/commit
Fix treesit-parse-string crash (bug#71012)
authorYuan Fu <casouri@gmail.com>
Sat, 1 Jun 2024 17:33:18 +0000 (10:33 -0700)
committerEshel Yaron <me@eshelyaron.com>
Sat, 8 Jun 2024 12:58:43 +0000 (14:58 +0200)
commita0446c2c984695c7c7a0b938b84f75126d6b5b5c
treea7d7322ec74e0a617c126868ecbfe49e9c919dde
parent2336a4a8019ade0e4ab00ed1ae8b6f70552ce009
Fix treesit-parse-string crash (bug#71012)

Parsing a large file with treesit-parse-string and then printing the
returned node crashes Emacs, because with-temp-buffer kills the temp
buffer when treesit-parse-string returns, and print.c tries to access
the node's position in the killed buffer.

* lisp/treesit.el (treesit-parse-string): Don't use with-temp-buffer.

(cherry picked from commit 00360258caddc0d8cf29ba3d9971125a06f8959b)
lisp/treesit.el