diff libinterp/parse-tree/oct-parse.yy @ 29322:6264fb660f72 stable

avoid crash on null statement list (bug #59938) * oct-parse.yy (base_parser::statement_list): Return early if lst is null.
author John W. Eaton <jwe@octave.org>
date Mon, 25 Jan 2021 13:09:45 -0500
parents 59696b24ea53
children 71ed922db66d 0a5b15007766
line wrap: on
line diff
--- a/libinterp/parse-tree/oct-parse.yy	Sat Jan 23 17:27:42 2021 +0100
+++ b/libinterp/parse-tree/oct-parse.yy	Mon Jan 25 13:09:45 2021 -0500
@@ -2502,6 +2502,9 @@
   void
   base_parser::statement_list (std::shared_ptr<tree_statement_list>& lst)
   {
+    if (! lst)
+      return;
+
     if (m_stmt_list)
       {
         // Append additional code to existing statement list.