[Laszlo-dev] For Review: Change 20071213-ptw-c Summary: Fix swf try/catch
Donald Anderson
dda at ddanderson.com
Fri Dec 14 11:13:49 PST 2007
Approved with two comments:
I'm only slightly worried about this -
short curval = bytes.getShort(patchloc);
if (curval == 0) { // XXXX
; // XXXX
} else if (lr.positive) {
offset = offset - curval;
}
I think we can remove the // XXXX lines. I'm thinking that
a previously stored 0 (is it possible?) would confuse this logic,
and also that we are depending on the ordering of the
two LabelReferences to get it right (first positive, second negative).
Probably won't ever be wrong from current code, but may be fragile if
used for something else...
Second, a nit: I think a comment above class Assembler.LabelReference
would help (especially if I have to look at this again :-)).
// relative indicates a normal relative reference
// if relative is false, this reference is part of label arithmetic,
// that is, a difference of two labels:
// (label2 - label1)
// this produces two references, one with positive=true and
// one with positive=false.
On Dec 13, 2007, at 4:23 PM, P T Withington wrote:
> Change 20071213-ptw-c by ptw at dueling-banjos.local on 2007-12-13
> 16:14:13 EST
> in /Users/ptw/OpenLaszlo/ringding-2
> for http://svn.openlaszlo.org/openlaszlo/trunk
>
> Summary: Fix swf try/catch
>
> Bugs Fixed:
> LPP-5252 'try/catch for swf blows up in large programs'
>
> Technical Reviewer: dda at ddanderson.com (pending)
>
> Details:
> Store the intermediate result as a relative value (i.e., store the
> branch offset to get to the first label, then subtract that from
> the branch offset of the second label to get the difference that
> you really want)
>
> Tests:
> I can compile the LFC with try/catch now
>
> Files:
> M WEB-INF/lps/server/src/org/openlaszlo/sc/Assembler.java
>
> Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20071213-
> ptw-c.tar
--
Don Anderson
Java/C/C++, Berkeley DB, systems consultant
Voice: 617-547-7881
Email: dda at ddanderson.com
WWW: http://www.ddanderson.com
More information about the Laszlo-dev
mailing list