@@ -165,7 +165,12 @@ static ZEND_INI_MH(OnUpdateJit)
165165static ZEND_INI_MH (OnUpdateJitDebug )
166166{
167167 zend_long * p = (zend_long * ) ZEND_INI_GET_ADDR ();
168- zend_long val = zend_atol (ZSTR_VAL (new_value ), ZSTR_LEN (new_value ));
168+ zend_string * errstr ;
169+ zend_long val = zend_ini_parse_quantity (new_value , & errstr );
170+ if (errstr ) {
171+ zend_error (E_WARNING , "Invalid \"%s\" setting: %s" , ZSTR_VAL (entry -> name ), ZSTR_VAL (errstr ));
172+ zend_string_release (errstr );
173+ }
169174
170175 if (zend_jit_debug_config (* p , val , stage ) == SUCCESS ) {
171176 * p = val ;
@@ -176,7 +181,13 @@ static ZEND_INI_MH(OnUpdateJitDebug)
176181
177182static ZEND_INI_MH (OnUpdateCounter )
178183{
179- zend_long val = zend_atol (ZSTR_VAL (new_value ), ZSTR_LEN (new_value ));
184+ zend_string * errstr ;
185+ zend_long val = zend_ini_parse_quantity (new_value , & errstr );
186+ if (errstr ) {
187+ zend_error (E_WARNING , "Invalid \"%s\" setting: %s" , ZSTR_VAL (entry -> name ), ZSTR_VAL (errstr ));
188+ zend_string_release (errstr );
189+ }
190+
180191 if (val >= 0 && val < 256 ) {
181192 zend_long * p = (zend_long * ) ZEND_INI_GET_ADDR ();
182193 * p = val ;
@@ -188,7 +199,13 @@ static ZEND_INI_MH(OnUpdateCounter)
188199
189200static ZEND_INI_MH (OnUpdateUnrollC )
190201{
191- zend_long val = zend_atol (ZSTR_VAL (new_value ), ZSTR_LEN (new_value ));
202+ zend_string * errstr ;
203+ zend_long val = zend_ini_parse_quantity (new_value , & errstr );
204+ if (errstr ) {
205+ zend_error (E_WARNING , "Invalid \"%s\" setting: %s" , ZSTR_VAL (entry -> name ), ZSTR_VAL (errstr ));
206+ zend_string_release (errstr );
207+ }
208+
192209 if (val > 0 && val < ZEND_JIT_TRACE_MAX_CALL_DEPTH ) {
193210 zend_long * p = (zend_long * ) ZEND_INI_GET_ADDR ();
194211 * p = val ;
@@ -201,7 +218,13 @@ static ZEND_INI_MH(OnUpdateUnrollC)
201218
202219static ZEND_INI_MH (OnUpdateUnrollR )
203220{
204- zend_long val = zend_atol (ZSTR_VAL (new_value ), ZSTR_LEN (new_value ));
221+ zend_string * errstr ;
222+ zend_long val = zend_ini_parse_quantity (new_value , & errstr );
223+ if (errstr ) {
224+ zend_error (E_WARNING , "Invalid \"%s\" setting: %s" , ZSTR_VAL (entry -> name ), ZSTR_VAL (errstr ));
225+ zend_string_release (errstr );
226+ }
227+
205228 if (val >= 0 && val < ZEND_JIT_TRACE_MAX_RET_DEPTH ) {
206229 zend_long * p = (zend_long * ) ZEND_INI_GET_ADDR ();
207230 * p = val ;
@@ -214,7 +237,13 @@ static ZEND_INI_MH(OnUpdateUnrollR)
214237
215238static ZEND_INI_MH (OnUpdateUnrollL )
216239{
217- zend_long val = zend_atol (ZSTR_VAL (new_value ), ZSTR_LEN (new_value ));
240+ zend_string * errstr ;
241+ zend_long val = zend_ini_parse_quantity (new_value , & errstr );
242+ if (errstr ) {
243+ zend_error (E_WARNING , "Invalid \"%s\" setting: %s" , ZSTR_VAL (entry -> name ), ZSTR_VAL (errstr ));
244+ zend_string_release (errstr );
245+ }
246+
218247 if (val > 0 && val < ZEND_JIT_TRACE_MAX_LOOPS_UNROLL ) {
219248 zend_long * p = (zend_long * ) ZEND_INI_GET_ADDR ();
220249 * p = val ;
0 commit comments