From 7239a1aff3c24a6e3e71b6ec749430966ad017bb Mon Sep 17 00:00:00 2001 From: Anton Pankratv Date: Wed, 3 Mar 2021 21:38:39 +0300 Subject: [PATCH] Fixed unsafe macro (#4486) --- .../include/openvino/cc/selective_build.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openvino/conditional_compilation/include/openvino/cc/selective_build.h b/openvino/conditional_compilation/include/openvino/cc/selective_build.h index 4c7ec5ffbcd..670b987ebe6 100644 --- a/openvino/conditional_compilation/include/openvino/cc/selective_build.h +++ b/openvino/conditional_compilation/include/openvino/cc/selective_build.h @@ -215,8 +215,8 @@ bool match(char const *region, Ctx && ctx, T && val, Case && cs, Cases&&... case // Return second argument from possible sequences {1, 0}, {0, 1, 0} #define OV_CC_SCOPE_IS_ENABLED2(arg1_or_junk) OV_CC_SCOPE_SECOND_ARG(arg1_or_junk 1, 0) -#define OV_SCOPE(Module, region) \ - if (OV_CC_SCOPE_IS_ENABLED(OV_PP_CAT3(Module, _, region))) +#define OV_SCOPE(Module, region) \ + for (bool ovCCScopeIsEnabled = OV_CC_SCOPE_IS_ENABLED(OV_PP_CAT3(Module, _, region)); ovCCScopeIsEnabled; ovCCScopeIsEnabled = false) // Switch is disabled #define OV_CC_SWITCH_0(Module, fn, ctx, val)