From cb7265e0e1389e45af40631cf1435d9137d79da9 Mon Sep 17 00:00:00 2001 From: Floris Gorter Date: Tue, 11 Aug 2026 16:42:10 +0200 Subject: [PATCH] Fix logical OR tautology in Zynq/ZynqMP architecture check. The condition `if(options.GetArchType() != Arch::ZYNQ || options.GetArchType() != Arch::ZYNQMP)` always evaluates to true. Replaced OR by AND. --- bisonflex/bif.tab.cpp | 2 +- parser/bif.y | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bisonflex/bif.tab.cpp b/bisonflex/bif.tab.cpp index 5eed53d..e9db5a2 100644 --- a/bisonflex/bif.tab.cpp +++ b/bisonflex/bif.tab.cpp @@ -812,7 +812,7 @@ namespace BIF { case 83: /* Line 670 of lalr1.cc */ #line 384 "parser/bif.y" - { if(options.GetArchType() != Arch::ZYNQ || options.GetArchType() != Arch::ZYNQMP) + { if(options.GetArchType() != Arch::ZYNQ && options.GetArchType() != Arch::ZYNQMP) LOG_WARNING("BIF attribute error !!! [keysrc_encryption] not supported for the specified architecture.\n\t Refer 'bootgen -bif_help' for more details"); currentBifOptions->SetEncryptionKeySource((yysemantic_stack_[(4) - (4)].encrkeysrc_t)); options.SetEncryptedKeySource((yysemantic_stack_[(4) - (4)].encrkeysrc_t)); } break; diff --git a/parser/bif.y b/parser/bif.y index 0e3370b..e5a1b9b 100755 --- a/parser/bif.y +++ b/parser/bif.y @@ -381,7 +381,7 @@ partition_content : /* empty */ | partition_content new_file_spec ; -other_spec : OBRACKET KEYSRC_ENCRYPTION EBRACKET key_src { if(options.GetArchType() != Arch::ZYNQ || options.GetArchType() != Arch::ZYNQMP) +other_spec : OBRACKET KEYSRC_ENCRYPTION EBRACKET key_src { if(options.GetArchType() != Arch::ZYNQ && options.GetArchType() != Arch::ZYNQMP) LOG_WARNING("BIF attribute error !!! [keysrc_encryption] not supported for the specified architecture.\n\t Refer 'bootgen -bif_help' for more details"); currentBifOptions->SetEncryptionKeySource($4); options.SetEncryptedKeySource($4); } | OBRACKET FSBL_CONFIG { if(options.GetArchType() == Arch::ZYNQ)