Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1330)

Unified Diff: third_party/libxml/src/xmlstring.c

Issue 1911853002: Alternate workaround for VS 2015 Update 2 code-gen bug (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libxml/README.chromium ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libxml/src/xmlstring.c
diff --git a/third_party/libxml/src/xmlstring.c b/third_party/libxml/src/xmlstring.c
index d9b5085db430e7ce6b260f885472bccdf92017b6..b6dd10121845c39d114ada3af3b61ea8f5a6b134 100644
--- a/third_party/libxml/src/xmlstring.c
+++ b/third_party/libxml/src/xmlstring.c
@@ -821,13 +821,6 @@ xmlCheckUTF8(const unsigned char *utf)
* the first 'len' characters of ARRAY
*/
-#if _MSC_FULL_VER && _MSC_FULL_VER == 190023918
-// Workaround for a /O1 ("s") optimization bug in VS 2015 Update 2, remove once
-// the fix is released. crbug.com/599427
-// https://connect.microsoft.com/VisualStudio/feedback/details/2582138
-#pragma optimize("t", on)
-#endif
-
int
xmlUTF8Strsize(const xmlChar *utf, int len) {
const xmlChar *ptr=utf;
@@ -842,20 +835,20 @@ xmlUTF8Strsize(const xmlChar *utf, int len) {
while ( len-- > 0) {
if ( !*ptr )
break;
- if ( (ch = *ptr++) & 0x80)
- while ((ch<<=1) & 0x80 ) {
+ if ( (ch = *ptr++) & 0x80) {
+ // Workaround for an optimization bug in VS 2015 Update 2, remove
+ // once the fix is released. crbug.com/599427
+ // https://connect.microsoft.com/VisualStudio/feedback/details/2582138
+ xmlChar ch2 = ch;
+ while ((ch2<<=1) & 0x80 ) {
ptr++;
- if (*ptr == 0) break;
- }
+ if (*ptr == 0) break;
+ }
+ }
}
return (ptr - utf);
}
-#if _MSC_FULL_VER && _MSC_FULL_VER == 190023918
-// Restore the original optimization settings.
-#pragma optimize("", on)
-#endif
-
/**
* xmlUTF8Strndup:
* @utf: the input UTF8 *
« no previous file with comments | « third_party/libxml/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698