ext/intl: Add collator sort conversion error handling - #22893
ext/intl: Add collator sort conversion error handling#22893LamentXU123 wants to merge 7 commits into
Conversation
|
not done reviewing will resume later, probably few more points down the road |
|
I would like to see tests inspired by these 1. A nested sort must not change the running comparator
Currently gives
2. The recorded failure must survive a re-entrant Collator call
Currently gives
3. A failing
|
|
Indeed, very good bug finding. Okay, give me a sec to figure this out. |
| @@ -0,0 +1,62 @@ | |||
| --TEST-- | |||
There was a problem hiding this comment.
I think you should add intl_get_error* assertions.
| u8str = intl_convert_utf16_to_utf8( | ||
| (UChar*) Z_STRVAL_P(utf16_zval), UCHARS( Z_STRLEN_P(utf16_zval) ), &status ); | ||
| if( !u8str ) { | ||
| collator_set_conversion_error(status, "Error converting string from UTF-16 to UTF-8"); |
There was a problem hiding this comment.
now, rv needs to be taken care of.
There was a problem hiding this comment.
note: no goto whatsoever so it seems useless
|
I ll do another tour some other time, it seems pretty much ok though. |
This fixes
Collator::sort(),collator_sort(),Collator::asort(), andcollator_asort()so string conversion failures during comparison are reported through the intl error mechanism instead of emitting a warning and continuing with an empty string.