From dac5d83e976dd96d0faabe8c5a428cdfb2e2d70c Mon Sep 17 00:00:00 2001 From: Mathieu Faverge <mathieu.faverge@inria.fr> Date: Tue, 5 Sep 2023 10:50:50 +0200 Subject: [PATCH] control: Add a protection on the value of ib --- control/context.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/control/context.c b/control/context.c index 66b844ccf..3f5e9ea86 100644 --- a/control/context.c +++ b/control/context.c @@ -11,7 +11,7 @@ * * @brief Chameleon context management routines * - * @version 1.2.0 + * @version 1.3.0 * @author Jakub Kurzak * @author Mathieu Faverge * @author Cedric Castagnede @@ -21,7 +21,7 @@ * @author Matthieu Kuhn * @author Loris Lucido * @author Terry Cojean - * @date 2022-02-22 + * @date 2023-09-11 * *** * @@ -379,6 +379,8 @@ int CHAMELEON_Set( int param, int value ) /* return CHAMELEON_ERR_ILLEGAL_VALUE; */ /* } */ chamctxt->ib = value; + /* Limit ib to nb */ + chamctxt->ib = chameleon_min( chamctxt->nb, chamctxt->ib ); if ( chamctxt->autotuning_enabled ) { chamctxt->autotuning_enabled = CHAMELEON_FALSE; -- GitLab