From 9b6dc1a5856229a0dfe1fb5838c1a1e2ea02cb6d Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Sun, 29 Aug 2010 15:09:34 +0000 Subject: Added workarounds for all instances of DMC overfetch bug git-svn-id: http://pugixml.googlecode.com/svn/trunk@640 99668b35-9821-0410-8761-19e4c4f06640 --- src/pugixpath.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/pugixpath.cpp') diff --git a/src/pugixpath.cpp b/src/pugixpath.cpp index c4134ed..e0ab730 100644 --- a/src/pugixpath.cpp +++ b/src/pugixpath.cpp @@ -2357,7 +2357,15 @@ namespace pugi if (!r.empty() && r[r.size() - 1] != ' ') r += ' '; } - else r += *it; + else + { + #ifdef __DMC__ + volatile // explicitly store to local to work around DMC bug (it loads 4 bytes from &*it otherwise) + #endif + char_t ch = *it; + + r += ch; + } } string_t::size_type pos = r.find_last_not_of(' '); @@ -2375,7 +2383,10 @@ namespace pugi for (string_t::iterator it = s.begin(); it != s.end(); ) { - char_t ch = *it; // explicitly store to local to work around DMC bug (it loads 4 bytes from &*it otherwise) + #ifdef __DMC__ + volatile // explicitly store to local to work around DMC bug (it loads 4 bytes from &*it otherwise) + #endif + char_t ch = *it; string_t::size_type pos = from.find(ch); -- cgit v1.2.3