@@ -410,9 +410,9 @@ PHP_FUNCTION(hash_init)
410410}
411411/* }}} */
412412
413- #define PHP_HASHCONTEXT_VERIFY (func , hash ) { \
413+ #define PHP_HASHCONTEXT_VERIFY (hash ) { \
414414 if (!hash->context) { \
415- zend_throw_error(NULL , "%s(): supplied resource is not a valid Hash Context resource", func ); \
415+ zend_argument_type_error(1 , "must be a valid Hash Context resource"); \
416416 RETURN_THROWS(); \
417417 } \
418418}
@@ -430,7 +430,7 @@ PHP_FUNCTION(hash_update)
430430 }
431431
432432 hash = php_hashcontext_from_object (Z_OBJ_P (zhash ));
433- PHP_HASHCONTEXT_VERIFY ("hash_update" , hash );
433+ PHP_HASHCONTEXT_VERIFY (hash );
434434 hash -> ops -> hash_update (hash -> context , (unsigned char * ) ZSTR_VAL (data ), ZSTR_LEN (data ));
435435
436436 RETURN_TRUE ;
@@ -451,7 +451,7 @@ PHP_FUNCTION(hash_update_stream)
451451 }
452452
453453 hash = php_hashcontext_from_object (Z_OBJ_P (zhash ));
454- PHP_HASHCONTEXT_VERIFY ("hash_update_stream" , hash );
454+ PHP_HASHCONTEXT_VERIFY (hash );
455455 php_stream_from_zval (stream , zstream );
456456
457457 while (length ) {
@@ -492,7 +492,7 @@ PHP_FUNCTION(hash_update_file)
492492 }
493493
494494 hash = php_hashcontext_from_object (Z_OBJ_P (zhash ));
495- PHP_HASHCONTEXT_VERIFY ("hash_update_file" , hash );
495+ PHP_HASHCONTEXT_VERIFY (hash );
496496 context = php_stream_context_from_zval (zcontext , 0 );
497497
498498 stream = php_stream_open_wrapper_ex (ZSTR_VAL (filename ), "rb" , REPORT_ERRORS , NULL , context );
@@ -525,7 +525,7 @@ PHP_FUNCTION(hash_final)
525525 }
526526
527527 hash = php_hashcontext_from_object (Z_OBJ_P (zhash ));
528- PHP_HASHCONTEXT_VERIFY ("hash_final" , hash );
528+ PHP_HASHCONTEXT_VERIFY (hash );
529529
530530 digest_len = hash -> ops -> digest_size ;
531531 digest = zend_string_alloc (digest_len , 0 );
0 commit comments