poke-devel
[Top][All Lists]
Advanced

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

[COMMITTED] pkl: fix invalid memory access in pkl_do_pass_1


From: Jose E. Marchesi
Subject: [COMMITTED] pkl: fix invalid memory access in pkl_do_pass_1
Date: Wed, 15 May 2024 19:10:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

2024-05-15  Jose E. Marchesi  <jemarch@gnu.org>

        * libpoke/pkl-pass.c (pkl_do_pass_1): Avoid accessing
        uninitialized memory.
---
 ChangeLog          | 5 +++++
 libpoke/pkl-pass.c | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6dbb32da..7eb3fe25 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-05-15  Jose E. Marchesi  <jemarch@gnu.org>
+
+       * libpoke/pkl-pass.c (pkl_do_pass_1): Avoid accessing
+       uninitialized memory.
+
 2024-05-01  Mohammad-Reza Nabipoor  <mnabipoor@gnu.org>
 
        * utils/pk-jojopatch.in: Disable auto-remap to improve speed.
diff --git a/libpoke/pkl-pass.c b/libpoke/pkl-pass.c
index 8c52e5eb..afb55e6d 100644
--- a/libpoke/pkl-pass.c
+++ b/libpoke/pkl-pass.c
@@ -308,8 +308,8 @@ pkl_do_pass_1 (pkl_compiler compiler,
 
   /* Check the COMPILED level in the node, and exit if the node
      doesn't need additional processing.  */
-  if (level != 0 && PKL_AST_TYPE_COMPILED (node) >= level
-      && PKL_AST_CODE (node) == PKL_AST_TYPE)
+  if (level != 0 && PKL_AST_CODE (node) == PKL_AST_TYPE
+      && PKL_AST_TYPE_COMPILED (node) >= level)
     goto _exit;
 
   /* Call the pre-order handlers from registered phases.  */
-- 
2.30.2




reply via email to

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