poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[COMMITTED master] pkl-ast: fix reference counting in pkl_ast_handle_bco


From: Jose E. Marchesi
Subject: [COMMITTED master] pkl-ast: fix reference counting in pkl_ast_handle_bconc_ass_stmt_1
Date: Sun, 31 Mar 2024 17:49:45 +0200

2024-03-31  Jose E. Marchesi  <jemarch@gnu.org>

        * libpoke/pkl-ast.c (pkl_ast_handle_bconc_ass_stmt_1): Fix
        reference counting in synthetized compount statement.
---
 ChangeLog         | 5 +++++
 libpoke/pkl-ast.c | 7 +++----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 81a81ffc..ed21052e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-03-31  Jose E. Marchesi  <jemarch@gnu.org>
+
+       * libpoke/pkl-ast.c (pkl_ast_handle_bconc_ass_stmt_1): Fix
+       reference counting in synthetized compount statement.
+
 2024-03-30  Jose E. Marchesi  <jemarch@gnu.org>
 
        * libpoke/ios-dev-mmap.c (ios_dev_mmap_open): Avoid using variable
diff --git a/libpoke/pkl-ast.c b/libpoke/pkl-ast.c
index c43118b2..627b1f1b 100644
--- a/libpoke/pkl-ast.c
+++ b/libpoke/pkl-ast.c
@@ -3083,7 +3083,7 @@ pkl_ast_handle_bconc_ass_stmt_1 (pkl_ast ast,
           {
             /* This is an l-value.  Append an assignment of a masked
                value with the given shift and increase the shift.  */
-            pkl_ast_node ass_stmt;
+            pkl_ast_node ass_stmt, stmts;
             pkl_ast_node rvalue;
             pkl_ast_node shift_node, shift_node_type;
             pkl_ast_node operand_type = PKL_AST_TYPE (operand);
@@ -3110,9 +3110,8 @@ pkl_ast_handle_bconc_ass_stmt_1 (pkl_ast ast,
 
             ass_stmt = pkl_ast_make_ass_stmt (ast, operand, rvalue);
 
-            PKL_AST_COMP_STMT_STMTS (comp_stmt)
-              = pkl_ast_chainon (PKL_AST_COMP_STMT_STMTS (comp_stmt),
-                                 ass_stmt);
+            stmts = pkl_ast_chainon (PKL_AST_COMP_STMT_STMTS (comp_stmt), 
ass_stmt);
+            PKL_AST_COMP_STMT_STMTS (comp_stmt) = ASTREF (stmts);
             break;
           }
         }
-- 
2.30.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]