{"id":240,"date":"2007-05-07T17:33:56","date_gmt":"2007-05-07T15:33:56","guid":{"rendered":"https:\/\/alax.info\/blog\/240"},"modified":"2007-05-07T17:39:12","modified_gmt":"2007-05-07T15:39:12","slug":"still-buggy-regular-expressions-visual-studio-net-2005-service-pack-1","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/240","title":{"rendered":"Still buggy regular expressions &#8211; Visual Studio .NET 2005 Service Pack 1"},"content":{"rendered":"<p>It is somewhat unexpected but it&#8217;s <a href=\"http:\/\/msdn.microsoft.com\/vstudio\/\">MS Visual Studio .NET 2005<\/a> <a href=\"http:\/\/msdn.microsoft.com\/vstudio\/support\/vs2005sp1\/default.aspx \">Service Pack 1<\/a> already and <a href=\"http:\/\/www.tutorials-se.com\/msdn\/CAtlRegExp-bugcrash\/\">exactly the same bug<\/a> in atlrx.h is <a href=\"http:\/\/groups.google.com\/group\/microsoft.public.msdn.general\/browse_thread\/thread\/5a11077a7dda291a\/3df3e42aa8ace614?lnk=st&#038;q=RE_NOTRANGE&#038;rnum=1#3df3e42aa8ace614\">still here<\/a>, though the place has been reworked with MS Visual Studio .NET 2005.<\/p>\n<p>So, atlrx.h near line 745, &#8220;case RE_NOTRANGE:&#8221; branch:<\/p>\n<blockquote><p>\n<em>size_t u = static_cast<size_t>(static_cast<_TUCHAR>(* ((RECHAR *) sz)));<\/em><br \/>\n<strong>ATLASSERT((u >> 3) < (256 \/ 8));<\/strong>\n<\/p><\/blockquote>\n<p>Add ATLASSERT line shown above and it will assert in Unicode Debug build&#8230;<\/p>\n<p><!--more--><br \/>\nComplete workaround for the problem:<\/p>\n<blockquote><p>\n\/\/ FIX: Alax.Info&#8217;s fix for the &#8220;Value is erroneously treated as signed&#8221; bug<br \/>\n#if TRUE<br \/>\nATLASSERT(sizeof *sz == 1);<br \/>\nsize_t u = (size_t) (UCHAR) *sz;<br \/>\n#else<br \/>\n<em>size_t u = static_cast<size_t>(static_cast<_TUCHAR>(* ((RECHAR *) sz)));<\/em><br \/>\n#endif<br \/>\nATLASSERT((u >> 3) < (256 \/ 8 ));\n<\/p><\/blockquote>\n<p>Original source code line is shown as <em>italic<\/em>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is somewhat unexpected but it&#8217;s MS Visual Studio .NET 2005 Service Pack 1 already and exactly the same bug in atlrx.h is still here, though the place has been reworked with MS Visual Studio .NET 2005. So, atlrx.h near line 745, &#8220;case RE_NOTRANGE:&#8221; branch: size_t u = static_cast(static_cast(* ((RECHAR *) sz))); ATLASSERT((u >> 3)&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/240\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,21],"tags":[],"class_list":["post-240","post","type-post","status-publish","format-standard","hentry","category-atl","category-seriously"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/240","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=240"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/240\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=240"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}