[Laszlo-dev] something in LzFormatter.formatToString is causing the flex compiler to emit bad code

Donald Anderson dda at ddanderson.com
Thu Mar 6 15:30:33 PST 2008


ouch.  Yes, report, tho I wouldn't be surprised
if it's already fixed in their head branch.

On Mar 6, 2008, at 4:53 PM, Henry Minsky wrote:

> When I add a break statement as the last line, it fixes it. I guess  
> I ought to report this as a bug to adobe...
>
>         switch (directive) {
>           case 'U':
>           case 'O':
>           case 'X':
>           case 'u':
>           case 'o':
>           case 'x':
>           if (value < 0) {
>             value = (- value);
>             var wid = Math.abs(parseInt(length));
>             if (isNaN(wid)) {
>               wid = Number(value).toString(radix).length;
>             }
>             var max = Math.pow(radix, wid);
>             value = max - value;
>           }
>           break;
>       }
>
>
> On Thu, Mar 6, 2008 at 4:22 PM, Henry Minsky  
> <henry.minsky at gmail.com> wrote:
> When I comment out this code block, I don't get the verifier error
>
>         switch (directive) {
>         case 'U': case 'O': case 'X':
>         case 'u': case 'o': case 'x':
>           if (value < 0) {
>             value = (- value);
>             // NOTE: [2006-11-17 ptw] Number('') -> NaN in swf, 0 in
>             // ECMA, hence use parseInt
>             var wid = Math.abs(parseInt(length));
>             if (isNaN(wid)) {
>               wid = Number(value).toString(radix).length;
>             }
>             var max = Math.pow(radix, wid);
>             value = max - value;
>           }
>       }
>
> mysterious...
>
>
>
>
>
>
>
> On Thu, Mar 6, 2008 at 3:55 PM, Henry Minsky  
> <henry.minsky at gmail.com> wrote:
> I'm trying to compile the LzFormatter mixin with LzText in swf9, and  
> am encountering some runtime error,
> the flash runtime gives a verifier error of some sort. I'm trying to  
> carve down the formatToString method
> to locate which statement is causing trouble. It doesn't seem to be  
> the inner function, which I suspected
> because we saw an earlier problem with non-global functions which  
> were assigned names. But our
> compiler isn't giving the local function a function name, and moving  
> it out to be a class method doesn't make
> any difference. So I'm just doing a binary search on the method body  
> to figure out what the offending code is....
>
>
>
> -- 
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com
>
>
>
>
> -- 
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com
>
>
>
>
> -- 
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com
>


--

Don Anderson
Java/C/C++, Berkeley DB, systems consultant

voice: 617-547-7881
email: dda at ddanderson.com
www: http://www.ddanderson.com




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20080306/d505b67f/attachment-0001.html


More information about the Laszlo-dev mailing list