<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Things That Work &#187; Things That Don&#8217;t Work</title>
	<atom:link href="http://thingsthatwork.net/index.php/category/things-that-dont-work/feed/" rel="self" type="application/rss+xml" />
	<link>http://thingsthatwork.net</link>
	<description>Thoughts on life and code</description>
	<lastBuildDate>Tue, 16 Feb 2010 00:25:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Obscure AS3 for-switch-if-false bug (VerifyError)</title>
		<link>http://thingsthatwork.net/index.php/2008/12/09/obscure-as3-for-switch-if-false-verify-erro/</link>
		<comments>http://thingsthatwork.net/index.php/2008/12/09/obscure-as3-for-switch-if-false-verify-erro/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 23:02:32 +0000</pubDate>
		<dc:creator>Katy Richard</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Things That Don't Work]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://thingsthatwork.net/?p=22</guid>
		<description><![CDATA[So we finally tracked down just how Jay broke Grooveshark Lite the other day. He apparently managed to trigger a very obscure language bug, that no one has really posted about, though if you dig deep enough into Adobe&#8217;s bug tracking system, you can find some reports of, though it&#8217;s supposedly fixed as of some [...]]]></description>
			<content:encoded><![CDATA[<p>So we finally tracked down just how Jay <a href="http://wanderr.com/jay/how-i-broke-grooveshark-lite/2008/12/07/" target="_blank">broke Grooveshark Lite</a> the other day.</p>
<p>He apparently managed to trigger a very obscure language bug, that no one has really posted about, though if you dig deep enough into Adobe&#8217;s bug tracking system, you can find some reports of, though it&#8217;s supposedly fixed as of some version of the compiler that I have no idea if it&#8217;s in production yet.</p>
<p>This is all it takes to break Actionscript with a nasty runtime error:</p>
<pre><code>
private function breakIt():void
{
    var arr:Array = [];
    for each (var obj:Object in arr) {
        switch ('s') {
            case 's':
                if (null) {
                }
            //break;
        }
    }
}
</code></pre>
<p>The key here is the nested for/switch/if and that the expression for the if statement evaluates to false, and that there is nothing in the case after the if.</p>
<p>Uncommenting the commented break statement will prevent the bug. Even a variable declaration on that line will prevent the bug. Removing the switch from inside the for loop will prevent the bug. Notice in this case the loop shouldn&#8217;t even be executing: the array is empty. Doesn&#8217;t matter, it crashes anyway.</p>
<p>The runtime error this triggers is &#8220;VerifyError: Error #1068: CLASSNAME and CLASSNAME cannot be reconciled.&#8221; where CLASSNAME is the name of the class that contains the above code.</p>
<p>So if you&#8217;re getting the above error in your code, check around for any constructs like the above. </p>
]]></content:encoded>
			<wfw:commentRss>http://thingsthatwork.net/index.php/2008/12/09/obscure-as3-for-switch-if-false-verify-erro/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
	</channel>
</rss>

