@@ -129,8 +129,10 @@ static zval* ZEND_FASTCALL zend_jit_hash_index_lookup_rw(HashTable *ht, zend_lon
129
129
zval * retval = _zend_hash_index_find (ht , idx );
130
130
131
131
if (!retval ) {
132
- zend_error (E_NOTICE ,"Undefined offset: " ZEND_LONG_FMT , idx );
133
- retval = zend_hash_index_update (ht , idx , & EG (uninitialized_zval ));
132
+ if (UNEXPECTED (zend_undefined_offset_write (ht , idx ) == FAILURE )) {
133
+ return NULL ;
134
+ }
135
+ retval = zend_hash_index_add_new (ht , idx , & EG (uninitialized_zval ));
134
136
}
135
137
return retval ;
136
138
}
@@ -153,12 +155,16 @@ static zval* ZEND_FASTCALL zend_jit_hash_lookup_rw(HashTable *ht, zend_string *s
153
155
if (UNEXPECTED (Z_TYPE_P (retval ) == IS_INDIRECT )) {
154
156
retval = Z_INDIRECT_P (retval );
155
157
if (UNEXPECTED (Z_TYPE_P (retval ) == IS_UNDEF )) {
156
- zend_error (E_NOTICE ,"Undefined index: %s" , ZSTR_VAL (str ));
158
+ if (UNEXPECTED (zend_undefined_index_write (ht , str ) == FAILURE )) {
159
+ return NULL ;
160
+ }
157
161
ZVAL_NULL (retval );
158
162
}
159
163
}
160
164
} else {
161
- zend_error (E_NOTICE ,"Undefined index: %s" , ZSTR_VAL (str ));
165
+ if (UNEXPECTED (zend_undefined_index_write (ht , str ) == FAILURE )) {
166
+ return NULL ;
167
+ }
162
168
retval = zend_hash_update (ht , str , & EG (uninitialized_zval ));
163
169
}
164
170
return retval ;
@@ -202,8 +208,10 @@ static zval* ZEND_FASTCALL zend_jit_symtable_lookup_rw(HashTable *ht, zend_strin
202
208
if (_zend_handle_numeric_str_ex (str -> val , str -> len , & idx )) {
203
209
retval = zend_hash_index_find (ht , idx );
204
210
if (!retval ) {
205
- zend_error (E_NOTICE ,"Undefined index: %s" , ZSTR_VAL (str ));
206
- retval = zend_hash_index_update (ht , idx , & EG (uninitialized_zval ));
211
+ if (UNEXPECTED (zend_undefined_index_write (ht , str ) == FAILURE )) {
212
+ return NULL ;
213
+ }
214
+ retval = zend_hash_index_add_new (ht , idx , & EG (uninitialized_zval ));
207
215
}
208
216
return retval ;
209
217
}
@@ -214,13 +222,17 @@ static zval* ZEND_FASTCALL zend_jit_symtable_lookup_rw(HashTable *ht, zend_strin
214
222
if (UNEXPECTED (Z_TYPE_P (retval ) == IS_INDIRECT )) {
215
223
retval = Z_INDIRECT_P (retval );
216
224
if (UNEXPECTED (Z_TYPE_P (retval ) == IS_UNDEF )) {
217
- zend_error (E_NOTICE ,"Undefined index: %s" , ZSTR_VAL (str ));
225
+ if (UNEXPECTED (zend_undefined_index_write (ht , str ) == FAILURE )) {
226
+ return NULL ;
227
+ }
218
228
ZVAL_NULL (retval );
219
229
}
220
230
}
221
231
} else {
222
- zend_error (E_NOTICE ,"Undefined index: %s" , ZSTR_VAL (str ));
223
- retval = zend_hash_update (ht , str , & EG (uninitialized_zval ));
232
+ if (UNEXPECTED (zend_undefined_index_write (ht , str ) == FAILURE )) {
233
+ return NULL ;
234
+ }
235
+ retval = zend_hash_add_new (ht , str , & EG (uninitialized_zval ));
224
236
}
225
237
return retval ;
226
238
}
@@ -531,13 +543,17 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_rw_helper(zend_array *ht, zval *di
531
543
if (UNEXPECTED (Z_TYPE_P (retval ) == IS_INDIRECT )) {
532
544
retval = Z_INDIRECT_P (retval );
533
545
if (UNEXPECTED (Z_TYPE_P (retval ) == IS_UNDEF )) {
534
- zend_error (E_NOTICE , "Undefined index: %s" , ZSTR_VAL (offset_key ));
546
+ if (UNEXPECTED (zend_undefined_index_write (ht , offset_key ) == FAILURE )) {
547
+ return NULL ;
548
+ }
535
549
ZVAL_NULL (retval );
536
550
}
537
551
}
538
552
} else {
539
- zend_error (E_NOTICE , "Undefined index: %s" , ZSTR_VAL (offset_key ));
540
- retval = zend_hash_update (ht , offset_key , & EG (uninitialized_zval ));
553
+ if (UNEXPECTED (zend_undefined_index_write (ht , offset_key ) == FAILURE )) {
554
+ return NULL ;
555
+ }
556
+ retval = zend_hash_add_new (ht , offset_key , & EG (uninitialized_zval ));
541
557
}
542
558
return retval ;
543
559
@@ -546,8 +562,10 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_rw_helper(zend_array *ht, zval *di
546
562
return retval ;
547
563
548
564
num_undef :
549
- zend_error (E_NOTICE ,"Undefined offset: " ZEND_LONG_FMT , hval );
550
- retval = zend_hash_index_update (ht , hval , & EG (uninitialized_zval ));
565
+ if (UNEXPECTED (zend_undefined_offset_write (ht , hval ) == FAILURE )) {
566
+ return NULL ;
567
+ }
568
+ retval = zend_hash_index_add_new (ht , hval , & EG (uninitialized_zval ));
551
569
return retval ;
552
570
}
553
571
0 commit comments