From b3b767d6b295b541341a027f059ee59db4e20998 Mon Sep 17 00:00:00 2001 From: hermanv Date: Mon, 18 Mar 2013 18:22:19 -0700 Subject: [PATCH] Initialize local that receives an error code only if there is actually an error. uidna_openUTS46 overwrites its error code argument only if there is actually an error. Hence, if the variable is not initialized to zero it may seem to the calling code that an error has ocurred. This diff initializes the variable and re-enables the failing test. --- hphp/runtime/ext/ext_intl.cpp | 2 +- .../vm/{idn-uts46-errors.php.disabled => idn-uts46-errors.php} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename hphp/test/vm/{idn-uts46-errors.php.disabled => idn-uts46-errors.php} (100%) diff --git a/hphp/runtime/ext/ext_intl.cpp b/hphp/runtime/ext/ext_intl.cpp index 86474770f..7bdd76d06 100644 --- a/hphp/runtime/ext/ext_intl.cpp +++ b/hphp/runtime/ext/ext_intl.cpp @@ -741,7 +741,7 @@ static Variant php_intl_idn_to_46(CStrRef domain, int64_t options, IdnVariant id int32_t converted_len; UIDNA *uts46; UIDNAInfo info = UIDNA_INFO_INITIALIZER; - UErrorCode status; + UErrorCode status = U_ZERO_ERROR; // Get UIDNA instance which implements UTS #46. uts46 = uidna_openUTS46(options, &status); diff --git a/hphp/test/vm/idn-uts46-errors.php.disabled b/hphp/test/vm/idn-uts46-errors.php similarity index 100% rename from hphp/test/vm/idn-uts46-errors.php.disabled rename to hphp/test/vm/idn-uts46-errors.php